I've been advised by my web host that I should use authenticated SMTP instead of
sendmail; that is, Net::SMTP using Authen::SASL. I'm getting no further
guidance, so I've tried variations on the following with no success:
use lib $SCRIPTS_DIR.'Authen'; #Contains Authen::SASL (not loaded by host)
use Net::SMTP;
$smtp = Net::SMTP->new('mymailserver.com',Debug=>1);
$smtp->auth('myaccount','mypassword');
$smtp->mail('[EMAIL PROTECTED]');
$smtp->to('[EMAIL PROTECTED]');
$smtp->data();
$smtp->datasend("To: [EMAIL PROTECTED]");
$smtp->datasend("From: [EMAIL PROTECTED]");
$smtp->datasend("Subject: Authenticated test message\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;
print "<br>Done";
exit;
Is this a reasonable approach, with perhaps some crucial detail overlooked? Or
does using Authen::SASL with Net::SMTP require a different approach?
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs