Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Testing for successful

by filmo (Scribe)
on Aug 17, 2001 at 01:32 UTC ( [id://105535]=perlquestion: print w/replies, xml ) Need Help??

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

To send a MIME entity using MIME::Lite, one uses
$email_msg->send();
The question is, is there a way to test if the message is successfully sent? Such as:
$test = $email_msg->send();
I didn't see anything about this in the documentation for MIME::Lite
--
Filmo the Klown

Replies are listed 'Best First'.
Re: Testing for successful
by kschwab (Vicar) on Aug 17, 2001 at 02:22 UTC
    From my MIME::Lite docs:
    send HOW, HOWARGS... 
    
    Class/instance method. This is the principal method for 
    sending mail, and for configuring how mail will be sent. 
    As an instance method (with no arguments), sends the
    message by whatever means has been set up (the default is
    to use the Unix "sendmail" program). Returns whatever 
    the mail-handling routine returns: this should be true on 
    success, false/exception on error: 
    
        $msg = MIME::Lite->new(From=>...);
        $msg->send || die "you DON'T have mail!";
    
    
    Of course, just because sendmail didn't error doesn't mean the mail got delivered. You could try the send_by_smtp method instead, but that's still subject to soft email bounces.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://105535]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-26 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found