in reply to Mail::Sender help

what mail deamon are you using?

there is a bug with mail::sender
it does not work with attachements in qmail
read the perldoc bug section for more


back in the day we didnt have no old school

Replies are listed 'Best First'.
Re: Re: Mail::Sender help
by Jenda (Abbot) on Mar 26, 2002 at 19:06 UTC

    This problem should be fixed in newest version.

    There were two problems in that code:

    • the "new Mail::Sender" doesn't return an undef in case it failed creating the object, but a negative error code. So you have to use either
      my $sender = new Mail::Sender (...); ref $sender or die "$Mail::Sender::Error\n";
      or
      my $sender = new Mail::Sender (...); $sender > 0 or die "$Mail::Sender::Error\n";
    • Pretty much the same holds for the Open() and OpenMultipart() methods. Actualy these two are more likely to fail than the object creation since at THIS point the module tries to connect to the server.
    • It's good that Blacksmith tests the result of SendFile(), but the mail is safely sent only if the $sender->Close() said all is OK as well. You can attach several files by several calls to SendFile() and the mail is finished only after you ->Close() it.