send mail using Net::SMTP::SSL

send mail using Net::SMTP::SSL

am 06.01.2009 02:16:32 von Bilashi Sahu

Hi,

I am trying to write a simple script to send email from Yahoo mail server a=
nd get "Authentication Failed" message. I could not figure out where I am d=
oing wrong.
Can you please look into it. I appreciate for your help.

Using this info for=A0 Yahoo SMPT server from http://help.yahoo.com/help/us=
/mail/pop/pop-11.html
=A0
thanks,
=A0
Bilashi


Here is my code


#!/usr/bin/perl -w
use strict;use warnings;
use Net::SMTP::SSL;


my $username =3D "bilashi";my $passwd =3D "mysecretpasswd";
my $from =3D 'bilashi_sahu@yahoo.com';
my $to =3D 'bilashi_sahu@yahoo.com';
my $smtphost =3D 'plus.smtp.mail.yahoo.com';

my $msg =3D "How are you?";


my $smtp =3D Net::SMTP::SSL->new($smtphost, Port =3D> 465, Debug =3D> 1) or=
die "Net::SMTP::SSL::new: =

$!";
$smtp->auth($username,$passwd) || die "Authentication failed\n";
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend($msg);
$smtp->dataend();
exit;


When I ran the program got following

perl sendmail.pl =

Net::SMTP::SSL>>> Net::SMTP::SSL(1.01)
Net::SMTP::SSL>>>=A0 IO::Socket::SSL(1.14)
Net::SMTP::SSL>>>=A0 =A0 IO::Socket::INET(1.31)
Net::SMTP::SSL>>>=A0 =A0 =A0 IO::Socket(1.30)
Net::SMTP::SSL>>>=A0 =A0 =A0 =A0 IO::Handle(1.27)
Net::SMTP::SSL>>>=A0 =A0 =A0 =A0 =A0 Exporter(5.58)
Net::SMTP::SSL>>>=A0 Net::Cmd(2.29)
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 220 smtp103.prem.mail.sp1.yahoo.com ESM=
TP
Net::SMTP::SSL=3DGLOB(0x9387414)>>> EHLO localhost.localdomain
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-smtp103.prem.mail.sp1.yahoo.com
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-PIPELINING
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250 8BITMIME
Authentication failed


=

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: send mail using Net::SMTP::SSL

am 06.01.2009 04:46:17 von sanket vaidya

=

Hi

As far as high know yahoo server doesn't support SSL. Moreover to access
yahoo smtp server via script you have to pay some monthly price. Try using
Net::SMTP for some server other than yahoo & check whether your script works
or not. =


Also FYI, Gmail server supports SSL.

Thanks
Sanket Vaidya

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Bilashi
Sahu
Sent: Tuesday, January 06, 2009 6:47 AM
To: activeperl@listserv.ActiveState.com
Subject: send mail using Net::SMTP::SSL

Hi,

I am trying to write a simple script to send email from Yahoo mail server
and get "Authentication Failed" message. I could not figure out where I am
doing wrong.
Can you please look into it. I appreciate for your help.

Using this info for=A0 Yahoo SMPT server from
http://help.yahoo.com/help/us/mail/pop/pop-11.html
=A0
thanks,
=A0
Bilashi


Here is my code


#!/usr/bin/perl -w
use strict;use warnings;
use Net::SMTP::SSL;


my $username =3D "bilashi";my $passwd =3D "mysecretpasswd"; my $from =3D
'bilashi_sahu@yahoo.com'; my $to =3D 'bilashi_sahu@yahoo.com'; my $smtphost=
=3D
'plus.smtp.mail.yahoo.com';

my $msg =3D "How are you?";


my $smtp =3D Net::SMTP::SSL->new($smtphost, Port =3D> 465, Debug =3D> 1) or=
die
"Net::SMTP::SSL::new: =

$!";
$smtp->auth($username,$passwd) || die "Authentication failed\n";
$smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend($msg);
$smtp->dataend(); exit;


When I ran the program got following

perl sendmail.pl
Net::SMTP::SSL>>> Net::SMTP::SSL(1.01)
Net::SMTP::SSL>>>=A0 IO::Socket::SSL(1.14) Net::SMTP::SSL>>>=A0 =A0
IO::Socket::INET(1.31) Net::SMTP::SSL>>>=A0 =A0 =A0 IO::Socket(1.30)
Net::SMTP::SSL>>>=A0 =A0 =A0 =A0 IO::Handle(1.27) Net::SMTP::SSL>>>=A0 =A0 =
=A0 =A0 =A0
Exporter(5.58) Net::SMTP::SSL>>>=A0 Net::Cmd(2.29)
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 220 smtp103.prem.mail.sp1.yahoo.com ESM=
TP
Net::SMTP::SSL=3DGLOB(0x9387414)>>> EHLO localhost.localdomain
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-smtp103.prem.mail.sp1.yahoo.com
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250-PIPELINING
Net::SMTP::SSL=3DGLOB(0x9387414)<<< 250 8BITMIME Authentication failed


=

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


http://www.patni.com
World-Wide Partnerships. World-Class Solutions. =

____________________________________________________________ _________ =


This e-mail message may contain proprietary, confidential or legally privil=
eged information for the sole use of the person or entity to whom this mess=
age was originally addressed. Any review, e-transmission dissemination or o=
ther use of or taking of any action in reliance upon this information by pe=
rsons or entities other than the intended recipient is prohibited. If you h=
ave received this e-mail in error kindly delete this e-mail from your recor=
ds. If it appears that this mail has been forwarded to you without proper a=
uthority, please notify us immediately at netadmin@patni.com and delete thi=
s mail.
____________________________________________________________ _________
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs