我发送的电子邮件代码在没有任何错误消息的情况下无法正常工作(“不起作用”我的意思是所有接缝都可以,但我我的邮箱中没有留言):
use strict;
use warnings;
use Email::Send;
use Email::Simple::Creator;
report_update();
sub report_update {
my $mailer = Email::Send->new(
{
mailer => 'SMTP::TLS',
mailer_args => [
Host => 'smtp.gmail.com',
Port => 587,
User => $CONFIG{EMAIL_USER},
Password => $CONFIG{EMAIL_PASS},
Hello => 'localhost',
]
}
);
my $email = Email::Simple->create(
header => [
From => $CONFIG{EMAIL_USER},
To => $CONFIG{TARGET_EMAIL},
Subject => 'Updated info finded!',
],
body => 'Updated info finded!',
);
eval { $mailer->send($email) };
die "Error sending email: $@" if $@;
print "Finished!\n";
}
你可以给我一个暗示它有什么问题吗?