in reply to Re: MIME::Lite 250 OK QUEUE ID???
in thread MIME::Lite 250 OK QUEUE ID???

Err, eval because I don't want it to die if it fails - I want to process the error. I don't know any other way being a novice :-) I have found, however, that and using die, funny enough, stops execution which is not the course of action I would like. I did look at last_send_successful() but my feeble attempts gained me: "Can't locate object method "last_send_successful" via package "MIME::Lite"" thus:
eval{$message->send}; if($@) { $result = "ERROR from MX: $mx_record\n$@\n"; } else { $result = $message->last_send_successful(); }

Replies are listed 'Best First'.
Re^3: MIME::Lite 250 OK QUEUE ID???
by Anonymous Monk on Oct 15, 2010 at 14:41 UTC
    The documentation implies that send will not die on failure, that it will simply return false, so
    $message->send or do_something(); $message->send; if( ! $message->last_send_successful ){ $ERROR = "ERROR from MX: $mx_record\n"; }
    If indeed send might die, the documentation needs updating (file a bug report).

    "Can't locate object method "last_send_successful" via package "MIME::Lite"

    Install the latest MIME::Lite

      MIME::Lite will die on various errors when sending via smtp.

      MIME::Lite says, of its send_by_smtp method:

      Returns: True on success, croaks with an error message on failure.

      and Carp says of croak:

      die of errors

      update: corrected reference to MIME::Lite.

      1: It dies, hence why I'm trapping for it. 2: It is the latest, downloaded and built from the very page that lists the method - perhaps the author needs to check where that link is/was pointing. 3: The answer to my actual question, rather than anal retentive output given by some anonymous numbnuts, is that successful SMTP status messages are not captured.
        It is the latest, downloaded and built from the very page that lists the method - perhaps the author needs to check where that link is/was pointing.

        ?? http://search.cpan.org/perldoc?MIME::Lite -> http://cpansearch.perl.org/src/RJBS/MIME-Lite-3.027/lib/MIME/Lite.pm

        =item last_send_successful This method will return TRUE if the last send() or send_by_XXX() metho +d call was successful. It will return defined but false if it was not successful, + and undefined if the object had not been used to send yet. =cut sub last_send_successful { my $self = shift; return $self->{last_send_successful}; }

        The answer to my actual question, rather than anal retentive output given by some anonymous numbnuts, is that successful SMTP status messages are not captured.

        Yup, its true, you catch more fruit flies with vinegar