Hello philkime,

Recently I was struggling with similar problems and I found that quite a few things can go wrong around using the starttls command.

You can build in extra error checking like how I did it in my recent post in Cool Uses For Perl: here

The code that I took from there shows:

# HELLO # Reminder: hello is also send again after starttls $smtp->hello( $cs->{ clientID } ) or die "Error: " . $smtp->message() ; # STARTTLS if ( !$smtp->starttls() ) { if ( ref $smtp eq 'Net::SMTP' ) { die "NET::SMPT failed to upgrade connection after connection m +essage: " . $smtp->message() . "Possible reasons for this may be firewalls or antivirus prote +ction software (such as mail shields). You can activate debugging for + IO::Socket::SSL and \$dbgSMTP to search for other possible reasons\n +" ; } else { die "starttls failed with Error: " . $smtp->message() . "You can activate debugging for IO::Socket::SSL and \$dbgSMTP +to search for possible reasons\n" ; } } ; # AUTHENTICATE ... # Finish with this line, it may contain extra error info if($@) { print STDERR "Error sending mail: $@"; }

Let us know what you find,

Veltro

edit: In case your $smtp object is a 'Net::SMTP_auth', then you need to change the line: if ( ref $smtp eq 'Net::SMTP' ) { to if ( ref $smtp eq 'Net::SMTP_auth' ) {. But now I am thinking again about this, here may actually be your problem. The auth method is not the one you think you are calling! Because after starttls the $smpt object is a Net::SMTP::_SSL (unless this was solved differently for Net::SMTP_auth)


In reply to Re: Net::SMTP_auth giving 421 errors with authentication by Veltro
in thread Net::SMTP_auth giving 421 errors with authentication by philkime

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.