Can you clarify what you mean by Net::SMTP not returning useful error codes to the caller?
I use Net::SMTP in various applications, and haven't noticed this deficiency. Since Net::SMTP is a subclass of Net::Cmd you can get the 3-digit return code very easily, as the following snippet shows:
$smtp = Net::SMTP->new($host); print ">>Connected to $host\n"; print $smtp->banner()."\n[".$smtp->code()."] ".$smtp->message()."\n"; $smtp->mail($fromaddr); print ">>MAIL FROM: $fromaddr<<\n[".$smtp->code()."] ".$smtp->message( +)."\n"; $smtp->to($toaddr); print ">>RCPT TO: $toaddr<<\n[".$smtp->code()."] ".$smtp->message()."\ +n"; $smtp->data(); print ">>DATA\n[".$smtp->code()."] ".$smtp->message()."\n"; $smtp->datasend("From: \"$fromname\" <$fromaddr>\n"); $smtp->datasend("To: $toaddr\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); $smtp->datasend("$data\n"); $smtp->dataend(); print ">>End of DATA\n[".$smtp->code()."] ".$smtp->message()."\n"; $smtp->quit; print ">>Closed connection\n[".$smtp->code()."] ".$smtp->message()."\n +";
Maybe I misunderstood you - if so, apologies.
But returning to the original problem, if it was once working and now is not, there could be something up with your mail server. Maybe someone has changed the config, so that it expects you to authenticate yourself first, or something. At the very least, you should amend your existing code to print out the responses from the server, and see what that tells you.
In reply to Re^2: Sending e-mail problem
by muntfish
in thread Sending e-mail problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |