如何使用Perl实现邮件发送功能

发布时间:2021-08-23 15:12 来源:亿速云 阅读:0 作者:Leah 栏目: 网络安全

如何使用Perl实现邮件发送功能,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

use Net::SMTP_auth;

$smtp = Net::SMTP_auth->new('mail.freelynet.com',
Hello => 'freelynet.com',
Debug => 1);

$smtp->auth('LOGIN', 'name', 'passwd');

$smtp->mail('qiuhj@freelynet.com');
$smtp->to('qiuhj@freelynet.com');

$smtp->data();
$smtp->datasend("From: qiuhj@freelynet.com n");
$smtp->datasend("To: sung@freelynet.com n");
$smtp->datasend("Subject: perl mailn");
$smtp->datasend("n");
$smtp->datasend("mail by perl n");
$smtp->dataend();

$smtp->quit;

[]

免责声明:本站发布的内容(图片、视频和文字)以原创、来自互联网转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系QQ:712375056 进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。