Syntactic Confectionery Delight | |
PerlMonks |
Net::SMTP success / failure responseby Anonymous Monk |
on Mar 31, 2004 at 08:26 UTC ( [id://341246]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: I'm trying to send some emails with Net::SMTP, and all goes well except that I can't figure out how to tell if the mail was sent successfully. I have to record which emails are real and which receive a "User Unknown" response. I saw this post Net:SMTP Printing to STDOUT, and according to that, and the Net::SMTP manual and Net::Cmd manual, I should do this:
If my $ret value is true, it was a sucess. If false, the mail was not sent. That works fine when the recipient's domain is handled by the same host as I am using as my SMTP relay (smtp.host.com) but if I am sending to a non-existing recipient on another host, I want to receive false, or a "User Unknown" message. Instead, it returns true. Any ideas how I can figure out if the mail made it without parsing the maillog, and without doing a lookup on each mailaddress, and using their MX record instead of smtp.host.com ?
Back to
Seekers of Perl Wisdom
|
|