今天用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;