Hello,
I'm slowly getting stuck. I have now tried everything I need, but cannot establish a connection with PHPMailer.
MyScript:
`public function senden($mail_adresse,$betreff,$nachricht){
$mailer = new PHPMailer();
$mailer->SMTPDebug = 4; // Enable verbose debug output
$mailer->isSMTP(); // Set mailer to use SMTP
$mailer->Host = 'mail.calces.de'; // Specify main and backup SMTP servers
$mailer->SMTPAuth = true; // Enable SMTP authentication
$mailer->Username = 'eric@calces.de'; // SMTP username
$mailer->Password = 'password'; // SMTP password
$mailer->SMTPSecure = 'tls'; // Enable TLS encryption, ssl also accepted
$mailer->Port = 587;
$mailer->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
); // TCP port to connect to
$mailer->CharSet = 'UTF-8'; // Charset setzen (für richtige Darstellung von Sonderzeichen/Umlauten)
$mailer->setFrom($this->gconfig->betreibermail,$this->gconfig->name); // Absenderemail und -name setzen
$mailer->addAddress($mail_adresse); // Empfängeradresse
$mailer->isHTML(true); // E-Mail enthält HTML-Bereich
$mailer->Subject = $betreff; // Betreff der Email
$mailer->Body = $this->Text($betreff,$nachricht); // Inhalt der Email
if(!$mailer->Send()){
return false;
}else{
return true;
}
}`
Log from PHPMailer:
2021-08-09 11:24:23 Connection: opening to mail.calces.de:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),)<br>
2021-08-09 11:24:23 Connection: opened<br>
2021-08-09 11:24:23 SMTP INBOUND: "220 f301.localdomain ESMTP Postfix (Ubuntu)"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 220 f301.localdomain ESMTP Postfix (Ubuntu)<br>
2021-08-09 11:24:23 CLIENT -> SERVER: EHLO calces.de<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-f301.localdomain"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-PIPELINING"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-SIZE 102400000"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-VRFY"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-ETRN"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-STARTTLS"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-8BITMIME"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-DSN"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250 SMTPUTF8"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 250-f301.localdomain250-PIPELINING250-SIZE 102400000250-VRFY250-ETRN250-STARTTLS250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 SMTPUTF8<br>
2021-08-09 11:24:23 CLIENT -> SERVER: STARTTLS<br>
2021-08-09 11:24:23 SMTP INBOUND: "220 2.0.0 Ready to start TLS"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS<br>
2021-08-09 11:24:23 CLIENT -> SERVER: EHLO calces.de<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-f301.localdomain"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-PIPELINING"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-SIZE 102400000"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-VRFY"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-ETRN"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-AUTH PLAIN LOGIN"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-8BITMIME"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250-DSN"<br>
2021-08-09 11:24:23 SMTP INBOUND: "250 SMTPUTF8"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 250-f301.localdomain250-PIPELINING250-SIZE 102400000250-VRFY250-ETRN250-AUTH PLAIN LOGIN250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 SMTPUTF8<br>
2021-08-09 11:24:23 Auth method requested: UNKNOWN<br>
2021-08-09 11:24:23 Auth methods available on the server: PLAIN,LOGIN<br>
2021-08-09 11:24:23 Requested auth method not available: <br>
2021-08-09 11:24:23 Auth method selected: LOGIN<br>
2021-08-09 11:24:23 CLIENT -> SERVER: AUTH LOGIN<br>
2021-08-09 11:24:23 SMTP INBOUND: "334 VXNlcm5hbWU6"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 334 VXNlcm5hbWU6<br>
2021-08-09 11:24:23 CLIENT -> SERVER: ZXJpY0BjYWxjZXMuZGU=<br>
2021-08-09 11:24:23 SMTP INBOUND: "334 UGFzc3dvcmQ6"<br>
2021-08-09 11:24:23 SERVER -> CLIENT: 334 UGFzc3dvcmQ6<br>
2021-08-09 11:24:23 CLIENT -> SERVER: TG90dGNoZW4yNw==<br>
2021-08-09 11:24:25 SMTP INBOUND: "535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6"<br>
2021-08-09 11:24:25 SERVER -> CLIENT: 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6<br>
2021-08-09 11:24:25 SMTP ERROR: Password command failed: 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6<br>
SMTP Error: Could not authenticate.<br>
2021-08-09 11:24:25 CLIENT -> SERVER: QUIT<br>
2021-08-09 11:24:25 SMTP INBOUND: "221 2.0.0 Bye"<br>
2021-08-09 11:24:25 SERVER -> CLIENT: 221 2.0.0 Bye<br>
2021-08-09 11:24:25 Connection: closed<br>
2021/08/09 12:48:35 [error] 32572#0: *92845 open() "/www/wwwroot/calces/.well-known/autoconfig/mail/config-v1.1.xml" failed (2: No such file or directory), client: 88.75.161.228, server: calces.de, request: "GET /.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=eric%40calces.de HTTP/2.0", host: "calces.de"
I also get the message with the login from Thunderbird.
I no longer have any idea what I'm doing wrong here. i tried all sorts of things with the username, but all without success.
I have also already integrated the ssl certificate.
I hope you can help me here.