in reply to Re: Sending e-mail problem
in thread Sending e-mail problem

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.

s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&;

Replies are listed 'Best First'.
Re^3: Sending e-mail problem
by Crackers2 (Parson) on Jun 24, 2004 at 18:52 UTC

    I stand corrected. I completely missed the reference in the Net::SMTP doc to Net::Cmd, and thus the code() and message methods.

    So my objection so Net::SMTP is invalid indeed. Thanks for enlightening me.