ITPub博客

首页 > IT基础架构 > 网络安全 > 用Perl实现邮件发送

用Perl实现邮件发送

原创 网络安全 作者:qiuhj1978 时间:2010-12-17 13:38:14 0 删除 编辑

今天用Perl实现了发送邮件,需要用Perl Package Manager下载了Net-SMTP_auth模块

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;

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/90000/viewspace-1043216/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    12
  • 访问量
    19660