我有这个脚本通过gmail smtp发送邮件到我的gmail帐户。它不工作,并提供已经提到的错误?连接失败:IO :: Socket :: INET:connect:timeout在Perl中显示。
use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
'smtp.gmail.com',
Hello => 'smtp.gmail.com',
Port => 587,
User => '[email protected]',
Password=> 'xxxxxx');
$mailer->mail('[email protected]');
$mailer->to('[email protected]');
$mailer->data;
$mailer->datasend("Sent from perl!");
$mailer->dataend;
$mailer->quit;
谢谢斯塔姆........ – kanwarpal 2012-02-17 14:00:15