我尝试通过Email::Sender::Transport::SMTP
发送消息。当我使用这样的独立脚本执行此操作时,一切正常:
my $transport = Email::Sender::Transport::SMTP->new({
host => ...,
ssl =>1,
port => 465,
localport => 10000,
sasl_username => '...',
sasl_password => '...',
});
my $email = Email::Simple->create(
header => [
To => '...',
From => '...',
Subject => '...',
],
body => "message",
);
eval {sendmail($email, { transport => $transport })};
但是当我尝试将其作为cgi(在lighttpd服务器上)执行时,我收到错误unable to establish SMTP connection
..这是lighttpd的麻烦吗?任何想法都非常欢迎!提前谢谢,人们!