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

Dear Monks, I am sending out about 15 email messages at a clip using MIME::LITE. How do I know if a message was emailed out successfully or if there was an error? Is there a way to print on the screen, "The file was emailed successfully or the file failed to send." Thanks

Replies are listed 'Best First'.
Re: MIME::LITE Email Confirmation
by dsheroh (Monsignor) on Aug 22, 2007 at 14:09 UTC
    The MIME::Lite docs state that the ->send method "Returns whatever the mail-handling routine returns: this should be true on success, false/exception on error".
      If is use the following: $msg->send(); if ($msg eq "true") { print "Sent"; } I still do not see any confirmation. Thanks, Tommy

        You can't use the string 'true' like that. Here $msg is your MIME::Lite object, not a string. You need to do:

        if( $msg->send() ) { print "Sent"; }

        Frank Wiles <frank@revsys.com>
        www.revsys.com