cypress has asked for the wisdom of the Perl Monks concerning the following question:
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' } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SMTP authentication misery
by gmargo (Hermit) on Nov 20, 2009 at 22:33 UTC | |
by cypress (Beadle) on Nov 23, 2009 at 17:56 UTC | |
by gmargo (Hermit) on Nov 23, 2009 at 18:35 UTC | |
by cypress (Beadle) on Nov 25, 2009 at 16:33 UTC | |
by gmargo (Hermit) on Nov 25, 2009 at 18:15 UTC | |
by cypress (Beadle) on Nov 25, 2009 at 17:32 UTC | |
|
Re: SMTP authentication misery
by zentara (Cardinal) on Nov 20, 2009 at 16:36 UTC | |
by cypress (Beadle) on Nov 20, 2009 at 17:41 UTC | |
by zentara (Cardinal) on Nov 23, 2009 at 12:53 UTC | |
by Gavin (Archbishop) on Nov 23, 2009 at 13:01 UTC | |
|
Re: SMTP authentication misery
by gman (Friar) on Nov 20, 2009 at 18:27 UTC | |
by cypress (Beadle) on Nov 20, 2009 at 19:24 UTC | |
|
Re: SMTP authentication misery
by pileofrogs (Priest) on Nov 20, 2009 at 17:45 UTC | |
by tirwhan (Abbot) on Nov 20, 2009 at 19:09 UTC | |
by cypress (Beadle) on Nov 20, 2009 at 19:20 UTC | |
by tirwhan (Abbot) on Nov 20, 2009 at 19:25 UTC | |
by cypress (Beadle) on Nov 20, 2009 at 19:15 UTC | |
by pileofrogs (Priest) on Nov 20, 2009 at 22:39 UTC |