mwhiting has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks. I'm having a little trouble with a message coming back at me from Net::SMTP when using the 'auth' method:
Unknown callback: 'authname'. (user|auth|language|pass)
Here's the code.
use Net::SMTP; use Authen::SASL; my $SMTPServer = 'myserver.net'; my $emailFrom = 'me@here.com'; my $emailTo = 'you@there.com'; my $user = 'username'; my $pass = 'password'; my $NetSMTP = Net::SMTP->new($SMTPServer, Port=>'587', Timeout=>60, +Debug=>1) || die "<br>Unable to open connection.<br>Error Message: $! +"; $NetSMTP->auth( user => $user, pass => $pass, ) || die "<br>Auth didn't work: $!<br>"; print "<br>sending from [$emailFrom] to [$emailTo]"; $NetSMTP->mail($emailFrom); $NetSMTP->to($emailTo); $NetSMTP->data(); $NetSMTP->datasend('test text'); $NetSMTP->dataend(); $NetSMTP->quit;
I know that callback is a part of of the Authen::SASL module, which Net::SMTP uses, but what would I do about it? Thanks!

Replies are listed 'Best First'.
Re: Net::SMTP failing - callback issue
by Anonymous Monk on Jul 06, 2012 at 18:14 UTC