Mit PHPMailer und Amazon SES

Ich bin mit Amazon SES. Ich bin versucht, senden Sie eine E-Mail von meinem PHP Skript mit PHPMailer.

Ich bereits überprüft zwei E-Mail-ids und E-Mails senden möchten, auf die diese E-mail-ids. Aber Es wirft die folgende Fehlermeldung.

FEHLER

SERVER -> CLIENT: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-693939519  QEPGeLndQQq5vJ53VMXU
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-email-smtp.amazonaws.com250-8BITMIME250-SIZE 10485760250- STARTTLS250-AUTH PLAIN LOGIN250 Ok
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 Ready to start TLS
CLIENT -> SERVER: EHLO localhost
SERVER -> CLIENT: 250-email-smtp.amazonaws.com250-8BITMIME250-SIZE 10485760250-STARTTLS250-AUTH PLAIN LOGIN250 Ok
CLIENT -> SERVER: AUTH LOGIN


SMTP NOTICE: EOF caught while checking if connected
SMTP connect() failed.
Mailer Error: SMTP connect() failed.

Das folgende ist meine PHP-Skript:

<?php

//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have   access to that
date_default_timezone_set('Etc/UTC');

require 'phpmailer/PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer();

//Tell PHPMailer to use SMTP
$mail->isSMTP();

//Enable SMTP debugging

$mail->SMTPDebug = 2;

//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';

//Set the hostname of the mail server
$mail->Host = 'email-smtp.us-east-1.amazonaws.com';

//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
//I tried PORT 25, 465 too
$mail->Port = 587;

//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';

//Whether to use SMTP authentication
$mail->SMTPAuth = true;

//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "SES Secret ID";

//Password to use for SMTP authentication
$mail->Password = "SES Secret Key";

//Set who the message is to be sent from
$mail->setFrom('[email protected]', 'sender');

//Set who the message is to be sent to
$mail->addAddress('[email protected]', 'receiver');

//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';


$mail->Body = 'This is a plain-text message body';
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';

//send the message, check for errors
if (!$mail->send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message sent!";
}
?>

Ich habe versucht, so viele Lösungen, die ich über das internet gefunden, vor allem stackoverflow.

Nichts funktioniert !!

Warum benutzt du PHPMailer bei Amazon bietet ein PHP-SDK? docs.aws.amazon.com/aws-sdk-php/guide/latest
Vielen Dank, dass Ihr an mich denkt, das PHP-SDK..!! Ich Habe Es Funktioniert !! Danke !!

InformationsquelleAutor BBHeeMAA | 2014-05-06

Schreibe einen Kommentar