For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > May 2005 > Making Net::SMTP Robust: Return Codes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Making Net::SMTP Robust: Return Codes
afrinspray

2005-05-27, 4:00 pm

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. Sinan Unur

2005-05-27, 8:57 pm

"afrinspray" <afrinspray@gmail.com> wrote in
news:1117217817.512543.124510@f14g2000cwb.googlegroups.com:

> 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

--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/c...guidelines.html
afrinspray

2005-05-27, 8:57 pm

Thanks Sinan. I should definitely do my research next time.

You rock!
(http://www.onlineseats.com/upload/c...con_motley2.gif -
motley crue image)

Mike

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com