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

# Send the message eval{$message->send};
Why eval? The documentation shows
$msg->send || die "you DON'T have mail!";
It also says After sending, the method last_send_successful() can be used to determine if the send was succesful or not.

Replies are listed 'Best First'.
Re^2: MIME::Lite 250 OK QUEUE ID???
by Leslie_jones (Initiate) on Oct 15, 2010 at 14:20 UTC
    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(); }
      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.