Amazon ec2 集成PHPmailer与Ec2

Amazon ec2 集成PHPmailer与Ec2,amazon-ec2,amazon-ses,Amazon Ec2,Amazon Ses,你好,我有这个代码发送邮件,但邮件没有被发送。我不能从在线服务器发送邮件,但我可以在本地发送邮件。可能是什么问题 $mail = new \Core\mailer\Phpmailer(); $mail->IsSMTP(); // we are going to use SMTP $mail->SMTPAuth = true; // enabled SMTP authentication $mail->SMTPSecure = "tls"; $mail->Host

你好,我有这个代码发送邮件,但邮件没有被发送。我不能从在线服务器发送邮件,但我可以在本地发送邮件。可能是什么问题

$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!";
}

我要试探一下,说你可能丢失了你的电子邮件地址
upload@irokingdev.com
作为亚马逊SES中的验证电子邮件地址

您可以从AWS SES控制台执行此操作:


是否产生任何错误?