2
我有電子郵件發送代碼不沒有任何錯誤消息的工作(由「不工作」我的意思是所有接縫OK,但我沒有消息我打開郵箱)發送電子郵件:通過Gmail
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: [email protected]" if [email protected];
print "Finished!\n";
}
你能給我一個提示它有什麼問題嗎?
「find」的無關緊要但過去式是「found」而不是「finded」。 – jira
謝謝。我會學習英語。 – gangabass