Making Net::SMTP Robust: Return Codes

Discussion in 'Perl Misc' started by afrinspray, May 27, 2005.

  1. afrinspray

    afrinspray Guest

    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
     
    afrinspray, May 27, 2005
    #1
    1. Advertising

  2. "afrinspray" <> wrote in
    news::

    > 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 <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, May 27, 2005
    #2
    1. Advertising

  3. afrinspray

    afrinspray Guest

    afrinspray, May 27, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg  --
    Replies:
    4
    Views:
    2,240
  2. Replies:
    1
    Views:
    866
    Real Gagnon
    Jan 13, 2005
  3. Replies:
    3
    Views:
    1,118
    Roedy Green
    Jan 24, 2006
  4. Replies:
    2
    Views:
    2,933
    Malcolm
    Aug 20, 2005
  5. Allen
    Replies:
    1
    Views:
    676
    Mark Rae [MVP]
    Dec 3, 2007
Loading...

Share This Page