您好我有这个代码发送邮件但邮件没有发送。我无法从在线服务器发送邮件,但我可以在本地发送邮件。可能是什么问题?
$mail = new \Core\mailer\Phpmailer();
$mail->IsSMTP(); // we are going to use SMTP
$mail->SMTPAuth = true; // enabled SMTP authentication
$mail->SMTPSecure = "tls";
$mail->Host = "email-smtp.eu-west-1.amazonaws.com";
$mail->Port = 587; // SMTP port to connect to GMail
$mail->Username = "******"; // user email address
$mail->Password = "*********"; // password in GMail
$mail->SetFrom('upload@irokingdev.com', 'IROKING'); //Who is sending the email
$mail->AddReplyTo('upload@irokingdev.com', 'iROKING Registration');
$mail->Subject = 'Registration on iROKING';
$mail->Body = $body;
$mail->AltBody = "Plain text message";
$destination = $to; // Who is addressed the email to
$mail->AddAddress($destination, "");
if(!$mail->Send()) {
echo "Error: " . $mail->ErrorInfo;
} else {
echo "Message sent correctly!";
}
答案 0 :(得分:1)
我会捅一下并说你可能在Amazon SES中错过了你的电子邮件地址upload@irokingdev.com
作为经过验证的电子邮件地址。
您可以从AWS SES控制台执行此操作: