Introduced "$smtp->auth($account,$password);" per Dave's suggestion. 
Get the following debug message:
 
Net::SMTP: Net::SMTP(2.15)
Net::SMTP:   Net::Cmd(2.18)
Net::SMTP:     Exporter(5.562)
Net::SMTP:   IO::Socket::INET(1.25)
Net::SMTP:     IO::Socket(1.26)
Net::SMTP:       IO::Handle(1.21)
Net::SMTP=GLOB(0x1822d28)<<< 220 smtp102.sbc.mail.mud.yahoo.com ESMTP
Net::SMTP=GLOB(0x1822d28)>>> EHLO Fluxion.mshome.net
Net::SMTP=GLOB(0x1822d28)<<< 250-smtp102.sbc.mail.mud.yahoo.com
Net::SMTP=GLOB(0x1822d28)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE
Net::SMTP=GLOB(0x1822d28)<<< 250-PIPELINING
Net::SMTP=GLOB(0x1822d28)<<< 250 8BITMIME
Can't locate object method "auth" via package "Net::SMTP" (perhaps you forgot to
 load "Net::SMTP"?) at sendmai! l3.pl line 10.
 
 
Now, why does it say "Net:SMTP" is not loaded ?
 
Thanks,
 
Joydeep
 

David Ressler <[EMAIL PROTECTED]> wrote:
Put this in your code after the "$smtp=Net::SMTP->new..." line:
 
     $smtp->auth($account,$password);
 
but the SMTP server needs to deal with SASL. Use values for $account and $password that authorize you for that server. My attempt at this failed until my service provider updated antiquated versions of the software.
 
Reference: Authen::SASL documentation
 
Dave

----- Original Message -----
Sent: Monday, December 19, 2005 12:37 PM
Subject: Sending email with authentication using Net::SMTP.

Hi,
 
Is anyone aware of any method of sending email with authentication using Net::SMTP or any other module. ! At this point I am experimenting trying to send email using perl v 5.6.1.
 
My ISP seems to require authentication when I run the script below with debug enabled.
 
Thanks,
 
Joydeep
 
 
#
# Test perl SMTP
#
use Net::SMTP;
$smtp = Net::SMTP->new("smtp.xyz.yahoo.com", Debug => 1); # connect to an SMTP server
die "Couldn't open connection: $!" if (!defined $smtp );
$smtp->mail( '[EMAIL PROTECTED]' ); # use the sender's address here
$smtp->to('[EMAIL PROTECTED]'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: [EMAIL PROTECTED]");
$smtp->datasend("From: myname@xyz.net\n");
$smtp->datasend("Subject: Testing perl SMTP.\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Testing perl SMTP....\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
print "Done!";

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to