mail::sendmail 客户端未验证错误

mail::sendmail client not authenticated error

我正在尝试使用 Mail::Sendmail 包发送邮件。但是我收到此错误:

MAIL FROM: error (530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM)

我怀疑这与我的 santaclaus@christmas.com 邮件有关?

    use Mail::Sendmail qw(sendmail %mailcfg);
unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'smtp.office365.com:587';
%mail = ( To => 'existingmail@outlook.com',
          From => 'santaclaus@christmas.com',
          Message => "Time for surprises and gifts is approaching..."
);

sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;

似乎 smtp.office365.com 需要 SMTP AUTH 命令(SMTP 身份验证)来接受电子邮件发送。
Mail::Sendmail 支持 SMTP 身份验证。

http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/Sendmail.pm

LIMITATIONS
[...]
No suport for the SMTP AUTH extension.