Making Net::SMTP Robust: Return Codes

A

afrinspray

How do I get return codes from Net::SMTP commands? For example, I'd
like to know if the recipient returns a 450 or 550 error on any of the
Net::SMTP steps.

Will it error out if one of these codes is returned? So if I put it in
an eval, will the $@ contain a "450 could not connect" type of message?

Thanks,
Mike
 
A

A. Sinan Unur

How do I get return codes from Net::SMTP commands? For example, I'd
like to know if the recipient returns a 450 or 550 error on any of the
Net::SMTP steps.

If you look at the documentation for Net::SMTP:

<URL: http://search.cpan.org/~gbarr/libnet-1.19/Net/SMTP.pm>

you will see:

SEE ALSO
Net::Cmd

Then, looking at

<URL: http://search.cpan.org/~gbarr/libnet-1.19/Net/Cmd.pm>

you will notice the ok, code, message, and status methods.
Will it error out if one of these codes is returned? So if I put it in
an eval, will the $@ contain a "450 could not connect" type of
message?

See above.

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,171
Messages
2,570,934
Members
47,472
Latest member
KarissaBor

Latest Threads

Top