Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Monks-- I'm having a problem with Net::SMTP. I have a script that uses Net::SMTP and MIME::Lite to send various messages. It uses the as_string() method from MIME::Lite to create a scalar which is then passed to the data() method in Net::SMTP. It works fine except when I try to send a complicated, multipart message. MIME::Lite seems to be returning to correct data to pass to Net::SMTP->data(), but this method call returns undef instead of the expected 1 (and the message, of course, is not sent). Any ideas? Are there certain chracters that data() can't handle? Thanks! =)

Replies are listed 'Best First'.
Re: Net::SMTP Problem...
by Jenda (Abbot) on Apr 11, 2003 at 22:20 UTC

    Why don't you just tell MIME::Lite to use Net::SMTP to send the message?:

    ... $msg->send('smtp', "smtp.myisp.net", Timeout=>60);

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature