2017-06-07 1 views
0

Ich versuche, E-Mail über PHP mit PHP-Mailer senden, aber es zeigt SMTP connect() fehlgeschlagen. Hier ist mein Code. kann nicht herausfinden, was das Problem ist. Wenn jemand hilft, Fehler zu verfolgen, wird es sehr hilfreich für mich sein.SMTP-Verbindung() fehlgeschlagen. Beim Senden von Authentifizierungs-E-Mail

$mail = new PHPMailer; 

$mail->isSMTP();         // Set mailer to use SMTP 
$mail->Host = 'dds.uemtv.com';     // Specify main and backup SMTP servers 
$mail->SMTPAuth = true;       // Enable SMTP authentication 
$mail->Username = '[email protected]';   // SMTP username 
$mail->Password = 'pssword'; // SMTP password 
$mail->SMTPSecure = 'tls';       // Enable TLS encryption, `ssl` also accepted 
$mail->Port = 587;         // TCP port to connect to 

$mail->setFrom('[email protected]', 'title'); 
$mail->addReplyTo($email, '$name'); 
$mail->addAddress($email); // Add a recipient 
//$mail->addCC('[email protected]'); 
//$mail->addBCC('[email protected]'); 

$mail->isHTML(true); // Set email format to HTML 


$bodyContent = '<h1>Your Registration Completed. </h1>' 
$mail->Subject = 'Verify Account- Rozgar'; 
$mail->Body = $bodyContent; 
if(!$mail->send()) { 

    echo $data->msg = $mail->ErrorInfo; 
} else { 
    // echo 'Message has been sent'; 
    echo $data->msg="Please Verify Your Email Address"; 
} 

Dieser Fehler wird angezeigt.

2017-06-07 05:36:44 SERVER -> CLIENT: 220-dds.uemtv.com ESMTP Exim 4.89 #1 Wed, 07 Jun 2017 10:36:40 +0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2017-06-07 05:36:44 CLIENT -> SERVER: EHLO localhost
2017-06-07 05:36:44 SERVER -> CLIENT: 250-dds.uemtv.com Hello localhost [182.186.132.245] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-STARTTLS 250 HELP
2017-06-07 05:36:44 CLIENT -> SERVER: STARTTLS
2017-06-07 05:36:45 SERVER -> CLIENT: 220 TLS go ahead
2017-06-07 05:36:46 CLIENT -> SERVER: EHLO localhost
2017-06-07 05:36:47 SERVER -> CLIENT: 250-dds.uemtv.com Hello localhost [182.186.132.245] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP
2017-06-07 05:36:47 CLIENT -> SERVER: AUTH LOGIN
2017-06-07 05:36:47 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2017-06-07 05:36:47 CLIENT -> SERVER: xxx=
2017-06-07 05:36:47 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2017-06-07 05:36:47 CLIENT -> SERVER: xxx
2017-06-07 05:36:49 SERVER -> CLIENT: 535 Incorrect authentication data
2017-06-07 05:36:49 SMTP ERROR: Password command failed: 535 Incorrect authentication data
2017-06-07 05:36:49 SMTP Error: Could not authenticate.
2017-06-07 05:36:49 CLIENT -> SERVER: QUIT
2017-06-07 05:36:50 SERVER -> CLIENT: 221 dds.uemtv.com closing connection
2017-06-07 05:36:50 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

+0

Das Problem ist im Protokoll. Nachricht vom SMTP-Server: _ "Wir erlauben nicht die Verwendung dieses Systems zum Transport von unerwünschten, 220- und/oder Massen-E-Mails" _. Der Code funktioniert, Sie werden einfach vom SMTP-Server blockiert. –

+0

Ich glaube nicht, dass das der Fehler ist, der Fehler ist weiter unten, wo der 535 falsche Authentifizierungsdatenteil ist. –

+0

@DavidFindlay Oh, sieh dir das an. Sie haben absolut Recht: _ "SMTP Error: Konnte nicht authentifizieren." _ –

Antwort

1

Es ist wahrscheinlich nichts falsch mit Ihrem Code. Der Server, den Sie verwenden, lässt das Weiterleiten ohne Authentifizierung nicht zu. In Ihrem Protokoll befinden sich Authentifizierungsfehler. Sie verwenden möglicherweise falsche Anmeldeinformationen.

+0

doppelt geprüft alles und Anmeldeinformationen ist korrekt, aber es zeigt immer noch diesen Fehler –

+0

Der Fehler ist ein Authentifizierungsfehler. Versuchen Sie es mit einem gewöhnlichen E-Mail-Client. –

+0

@ImranIqbal Die Protokolle stimmen nicht überein. _ "SMTP-Fehler: konnte nicht authentifiziert werden." _. Sprechen Sie mit Ihrem Hosting-Anbieter für die E-Mail. –

1

es scheint kein Code-Problem, und als solches nicht etwas, was wir für Sie beheben können. Sprechen Sie mit Ihrem ISP, lesen Sie die Dokumentation.

So either your Host setting is wrong, or you are being redirected by your ISP. Either way, this is all covered in the troubleshooting guide the error message pointed you at, which is why it's there.

Verwandte Themen