Hallo,
ich habe seit kurzem Probleme mit dem PhPMailer.
Installiert war die Version 5.2.4 und lief ohne Probleme mit dem nachfolgendem Script
Seit kurzem bekomme ich die Mitteilung, dass er sich nicht mit dem Server verbinden kann.
Daraufhin habe ich die neuste Version des PhPMailers installiert.
leider ist auch das ohne Erfolg geblieben.
Als Ausgabe kam:
2020-05-23 07:36:47 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMail...roubleshooting
SMTP connect() failed. https://github.com/PHPMailer/PHPMail...roubleshooting
ping zum Server war erfolgreich
openssl nicht installiert
Firewall abgeschaltet
habe dann auf TLS und Port 587 umgestellt und erhielt nachfolgende Meldung
2020-05-23 08:05:30 SERVER -> CLIENT: 220 smtp.strato.de ESMTP RZmta (P1 -)
2020-05-23 08:05:30 CLIENT -> SERVER: EHLO rsbhannover.cycling-register.bike
2020-05-23 08:05:31 SERVER -> CLIENT: 250-smtp.strato.de greets 5.189.159.60250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-DELIVERBY250-SIZE 104857600250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5250-STARTTLS250-BURL imap250-CHUNKING250 HELP
2020-05-23 08:05:31 CLIENT -> SERVER: STARTTLS
2020-05-23 08:05:31 SERVER -> CLIENT: 220 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
2020-05-23 08:05:31 CLIENT -> SERVER: QUIT
2020-05-23 08:05:31 SERVER -> CLIENT:
2020-05-23 08:05:31 SMTP ERROR: QUIT command failed:
SMTP Error: Could not connect to SMTP host.
SMTP Error: Could not connect to SMTP host.
Per Webmail ist der Mailaccount unter dem eingegebenen Passwort erreichbar.
Bin mit meinen Latein am Ende und brauche eure Hilfe.
Danke
ich habe seit kurzem Probleme mit dem PhPMailer.
Installiert war die Version 5.2.4 und lief ohne Probleme mit dem nachfolgendem Script
PHP-Code:
// Mailversand
error_reporting(E_ALL);
error_reporting(E_STRICT);
require_once('../../08_phpmailer/class.phpmailer.php');
//include("../class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = preg_replace('/[\]/','',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.strato.de"; // SMTP server
$mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "smtp.strato.de"; // sets the SMTP server
$mail->SMTPSecure = "ssl";
$mail->Port = 465; // set the SMTP port for the GMAIL server
Daraufhin habe ich die neuste Version des PhPMailers installiert.
PHP-Code:
// E-Mail versenden
use PHPMailer\PHPMailer\PHPMailer ;
use PHPMailer\PHPMailer\Exception ;
/* Exception class. */
require_once ('05_phpmailer/phpmailer/src/Exception.php');
/* The main PHPMailer class. */
require_once ('05_phpmailer/phpmailer/src/PHPMailer.php');
/* SMTP class, needed if you want to use SMTP. */
require_once ('05_phpmailer/phpmailer/src/SMTP.php');
/* SMTP parameters. */
/* Tells PHPMailer to use SMTP. */
$mail->IsSMTP();
$mail-> SMTPDebug = 2;
/* SMTP server address. */
$mail->Host = 'smtp.strato.de';
/* Use SMTP authentication. */
$mail->SMTPAuth = true;
/* Set the encryption system. */
$mail->SMTPSecure = 'ssl';
/* Set the SMTP port. */
$mail->Port = '465';
/* SMTP authentication username. */
$mail->Username = 'xxxxxx@cycling-register.bike';
/* SMTP authentication password. */
$mail->Password = 'xxxxxxxxx';
/* Finally send the mail. */
$mail->send();
Als Ausgabe kam:
2020-05-23 07:36:47 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMail...roubleshooting
SMTP connect() failed. https://github.com/PHPMailer/PHPMail...roubleshooting
ping zum Server war erfolgreich
openssl nicht installiert
Firewall abgeschaltet
habe dann auf TLS und Port 587 umgestellt und erhielt nachfolgende Meldung
2020-05-23 08:05:30 SERVER -> CLIENT: 220 smtp.strato.de ESMTP RZmta (P1 -)
2020-05-23 08:05:30 CLIENT -> SERVER: EHLO rsbhannover.cycling-register.bike
2020-05-23 08:05:31 SERVER -> CLIENT: 250-smtp.strato.de greets 5.189.159.60250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-DELIVERBY250-SIZE 104857600250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5250-STARTTLS250-BURL imap250-CHUNKING250 HELP
2020-05-23 08:05:31 CLIENT -> SERVER: STARTTLS
2020-05-23 08:05:31 SERVER -> CLIENT: 220 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
2020-05-23 08:05:31 CLIENT -> SERVER: QUIT
2020-05-23 08:05:31 SERVER -> CLIENT:
2020-05-23 08:05:31 SMTP ERROR: QUIT command failed:
SMTP Error: Could not connect to SMTP host.
SMTP Error: Could not connect to SMTP host.
Per Webmail ist der Mailaccount unter dem eingegebenen Passwort erreichbar.
Bin mit meinen Latein am Ende und brauche eure Hilfe.
Danke
Kommentar