Hi all,

Mac OS X Leopard, ActivePerl 5.10

Trying in vain to send email to myself through our ISP (at&t/sbcglobal/yahoo) which requires SSL/TLS authentication on port 465. The following code --

use Net::SMTP_auth; my $smtp = Net::SMTP_auth->new( 'smtp.att.yahoo.com', Hello => '826michigan.org', Debug => 1); my $auth_return = $smtp->auth('PLAIN', 'info@826michigan.org', 'plaint +ext_pw_here'); my $mail_return = $smtp->mail($ENV{USER}); my $to_return = $smtp->to('info@826michigan.org'); $smtp->data(); $smtp->datasend("hi\n"); $smtp->dataend(); $smtp->quit; print "\nauth_return = $auth_return\n"; print "mail_return = $mail_return\n"; print "to_return = $to_return\n";

-- generates the following error --

Net::SMTP_auth>>> Net::SMTP_auth(0.08) Net::SMTP_auth>>> Net::SMTP(2.31) Net::SMTP_auth>>> Net::Cmd(2.29) Net::SMTP_auth>>> Exporter(5.63) Net::SMTP_auth>>> IO::Socket::INET(1.31) Net::SMTP_auth>>> IO::Socket(1.31) Net::SMTP_auth>>> IO::Handle(1.28) Net::SMTP_auth=GLOB(0x86eea0)<<< 220 smtp123.sbc.mail.re3.yahoo.com ES +MTP Net::SMTP_auth=GLOB(0x86eea0)>>> EHLO 826michigan.org Net::SMTP_auth=GLOB(0x86eea0)<<< 250-smtp123.sbc.mail.re3.yahoo.com Net::SMTP_auth=GLOB(0x86eea0)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE Net::SMTP_auth=GLOB(0x86eea0)<<< 250-PIPELINING Net::SMTP_auth=GLOB(0x86eea0)<<< 250 8BITMIME Net::SMTP_auth=GLOB(0x86eea0)>>> AUTH PLAIN Net::SMTP_auth=GLOB(0x86eea0)<<< 334 ok, go on Net::SMTP_auth=GLOB(0x86eea0)>>> aW5mb0A4MjZtaWNoaWdhbi5vcmcAaW5mb0A4M +jZtaWNoaWdhbi5vcmcAbW9uc3RlcjgyNg== Net::SMTP_auth=GLOB(0x86eea0)<<< 530 Access denied Net::SMTP_auth=GLOB(0x86eea0)>>> MAIL FROM:<826michigan> Net::SMTP_auth: Unexpected EOF on command channel at email.txt line 9 auth_return = mail_return = to_return = 0

The problem, of course, is with line 8, $SMTP->auth, as I'm not returning 'true' there.

Any ideas on what's wrong? Previous perlmonks posts addressing the same error suggest that the server may be dropping the connection, but don't suggest a solution. ('Cuz maybe there isn't one, apart from switching ISPs?)

Thanks. cypress

PS: This newbie's also curious about how $ENV{USER} works.

Another PS: The following different code blew up with the error:

You cannot inherit from a Moose Role (Email::Sender::Transport) at /Us +ers/826michigan/Library/ActivePerl-5.10/lib/Moose.pm line 53 ....

(I don't have sufficient coding background to mess with this problem.)

use Email::Sender::Transport::SMTP::TLS; use Email::Simple; use Email::Simple::Creator; my $message = Email::Simple->create( header => [ To => 'info@826michigan.org', From => 'info@826michigan.org', Subject => "hi\n", ], body => "just hi\n" ); my $sender = Email::Sender::Transport::SMTP::TLS->new( host => 'smtp.att.yahoo.com', port => 465, username => 'info@826michigan.org', password => 'plaintext_pw_here' ); $sender->send( $message, { from => 'info@826michigan.org', to => 'info@826michigan.org' } );

In reply to SMTP authentication misery by cypress

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.