PHPMailer kann keine E-Mails senden
Mein Projekt enthält eine Funktion zum Versenden von E-MailsPHPMailer
. Das Senden von E-Mails von meinem Localhost-Server funktioniert einwandfrei, aber das Senden von E-Mails wurde heute gestoppt, und jetzt wird diese Fehlermeldung angezeigt
SMTP Error: Could not connect to SMTP host.
Ich habe diesen Code hinzugefügt$mail->SMTPDebug = 1;
um Debug-Fehler anzuzeigen und zeigt mir jetzt diese Meldung an:
SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. (0) SMTP Error: Could not connect to SMTP host
ich habe schonenabled extension=php_openssl.dll
imphp.ini
.
Das ist mein Code:
$mail = new PHPMailer();
$mail->SMTPSecure = 'ssl';
$mail->IsSMTP();
$mail->Username = "[email protected]"; // your GMail user name
$mail->Password = "password";
$mail->AddAddress($email); // recipients email
$mail->FromName = "username"; // readable name
$mail->IsHTML(true);
$mail->Subject = "title";
$mail->Body = " Message";
$mail->SMTPDebug = 1;
$mail->Host = "ssl://smtp.gmail.com"; // GMail
$mail->Port = 465;
$mail->IsSMTP(); // use SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->From = $mail->Username;
if($mail->Send()){
} else {
}
Vielen Dank