in reply to Re: Re: Net::SMTP and debugging ?
in thread Net::SMTP and debugging ?

Glad CGI::Carp was helpful. However I must say that I strongly discourage hand generating SMTP mails. Use MIME::Lite instead. Let it do the work of making sure things are set up correctly.

The new version will have much more powerful features for handling SMTP transport, but you dont need any of those features from what I can tell.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


Replies are listed 'Best First'.
Re: Re: Re: Re: Net::SMTP and debugging ?
by peterr (Scribe) on Oct 07, 2003 at 01:02 UTC
    Glad CGI::Carp was helpful

    Yes, after seeing "premature end of scripts headers" for a long while, and _not_ knowing where it crashes, has been very fustrating. Now I can see warning messages, and for testing the email, I can see ALL the echos back from the email server.

    However I must say that I strongly discourage hand generating SMTP mails. Use MIME::Lite instead. Let it do the work of making sure things are set up correctly.

    Although the Net::SMTP has been working 100% okay for a small Perl script (about 170 lines, most of it email 'body'), when I added it to a much larger Perl script, as a sub routine, it is not working all the time. From the 'logs', the email server is talking okay, and I should get all the emails back, but I don't. On the converse, the 'feedback' form, which uses FormMail.pl and the CGI::NMS::Mailer::SMTP modules, it works 100% on 2 domains ??

    So, there is something strange happening with Net::SMTP, and because the emails are online order confirmations, I _really_ need them ALL to come to me first. I had a quick look at MIME:Lite, it looks very easy to use. We have Perl 5.61, so I hope it is installed, so that I can test it. The emails I'm sending aren't complex (attachments will be later), they are just a few standard email headers, and the body is a mixture of 'fixed' text, plus some text created from some MySQL work.

    Thanks, :)

    Peter

Re: Re: Re: Re: Net::SMTP and debugging ?
by peterr (Scribe) on Oct 07, 2003 at 01:41 UTC
    Use MIME::Lite instead

    Well, thanks, a small one line test worked just fine, no authentication needed, and the headers look more like the (NMS) FormMail.pl headers. The website does state they have SENDMAIL, but they _actually_ use Exim. I just used the example for the headers and the body, and then

    $msg->send;
    Looks like that's all I need. As there is quite a lot of email 'body', is the best way to do multiple

    Data =>"Some test in the body part" )

    .. or some other preferred method, considering there are a few MySQL 'FOR' loops to build parts of the email body.

    Thanks,

    Peter