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

Hi folk, I'm new in Perl and now I'm trying to create a simple script for sending emails with MIME::Lite::TT::HTML and DBI. I need to get back into script MTAs internal Message-ID (i.e. what MTA returns with 250 OK id=1RxeMw-0003AV-3A after ending the 'data' command with "." by itself) for updating DB with it and later analyzing. I have tried
my $r = $msg->send; print $r, "\n";
but it return just '1'. Please point me the correct way to accomplish this task.

Replies are listed 'Best First'.
Re: get back into script MTAs Message-ID
by Anonymous Monk on Feb 15, 2012 at 15:23 UTC
    It is wrong to rely on the internal MTA id. Instead create your messages with a standard-conform Message-ID header and record this field. It is possible to find stalled messages in the MTA with this piece of data.
Re: get back into script MTAs Message-ID
by nemesdani (Friar) on Feb 16, 2012 at 07:45 UTC
    I've never worked with these modules but I assume that you get '1' simply because the send was succesful. Aou should read the documentation concerning return values.