Ich hab mal ein PHP-Script gebaut, mit dem man den Versand über PHP testen kann. Dann siehst du auch was der Server von Web.de zurückgibt.
Musst vorher dann noch in dem Ordner PHPMailer installieren.
<?php
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
require __DIR__ . '/vendor/autoload.php';
// Configure me!
// ------------------------------
/** E-mail address to send from */
$from = 'sender@example.com';
/** E-mail address to send to */
$to = 'recipient@web.de';
/** Subject of e-mail */
$subject = 'Testnachricht';
/** Body of e-mail */
$body = 'Das ist eine Testnachricht.';
// ------------------------------
$mail = new PHPMailer(true);
try {
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
[, $hostpart] = explode('@', $to);
getmxrr($hostpart, $mxhosts);
$mail->Host = $mxhosts[0];
$mail->Port = 25;
$ownIp = trim(file_get_contents('http://ipv4.icanhazip.com/'));
$mail->Hostname = gethostbyaddr($ownIp);
$mail->setFrom($from);
$mail->addAddress($to);
$mail->CharSet = PHPMailer::CHARSET_UTF8;
$mail->Subject = $subject;
$mail->Body = $body;
$mail->send();
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Alles anzeigen
Die Ausgabe davon wäre dann interessant.
Im Erfolgsfall sollte die Ausgabe dann so in der Art aussehen:
2023-03-21 12:39:58 SERVER -> CLIENT: 220 web.de (mxweb011) Nemesis ESMTP Service ready
2023-03-21 12:39:58 CLIENT -> SERVER: EHLO a2fac.netcup.net
2023-03-21 12:39:58 SERVER -> CLIENT: 250-web.de Hello a2fac.netcup.net [188.68.47.172]
250-8BITMIME
250-SIZE 157286400
250 STARTTLS
2023-03-21 12:39:58 CLIENT -> SERVER: STARTTLS
2023-03-21 12:39:58 SERVER -> CLIENT: 220 OK
2023-03-21 12:39:58 CLIENT -> SERVER: EHLO a2fac.netcup.net
2023-03-21 12:39:58 SERVER -> CLIENT: 250-web.de Hello a2fac.netcup.net [188.68.47.172]
250-8BITMIME
250 SIZE 157286400
2023-03-21 12:39:58 CLIENT -> SERVER: MAIL FROM:<sender@example.com>
2023-03-21 12:39:58 SERVER -> CLIENT: 250 Requested mail action okay, completed
2023-03-21 12:39:58 CLIENT -> SERVER: RCPT TO:<recipient@web.de>
2023-03-21 12:39:58 SERVER -> CLIENT: 250 OK
2023-03-21 12:39:58 CLIENT -> SERVER: DATA
2023-03-21 12:39:58 SERVER -> CLIENT: 354 Start mail input; end with <CRLF>.<CRLF>
2023-03-21 12:39:58 CLIENT -> SERVER: Date: Tue, 21 Mar 2023 13:39:58 +0100
2023-03-21 12:39:58 CLIENT -> SERVER: To: recipient@web.de
2023-03-21 12:39:58 CLIENT -> SERVER: From: sender@example.com
2023-03-21 12:39:58 CLIENT -> SERVER: Subject: Testnachricht
2023-03-21 12:39:58 CLIENT -> SERVER: Message-ID: <d3NWofEii5G62oZcok0U6nNMiavuNgKHWSun4mAIPs@a2fac.netcup.net>
2023-03-21 12:39:58 CLIENT -> SERVER: X-Mailer: PHPMailer 6.8.0 (https://github.com/PHPMailer/PHPMailer)
2023-03-21 12:39:58 CLIENT -> SERVER: MIME-Version: 1.0
2023-03-21 12:39:58 CLIENT -> SERVER: Content-Type: text/plain; charset=utf-8
2023-03-21 12:39:58 CLIENT -> SERVER:
2023-03-21 12:39:58 CLIENT -> SERVER: Das ist eine Testnachricht.
2023-03-21 12:39:58 CLIENT -> SERVER:
2023-03-21 12:39:58 CLIENT -> SERVER: .
2023-03-21 12:39:58 SERVER -> CLIENT: 250 Requested mail action okay, completed: id=1Ml5i4-1qLKUc2prQ-00lXXu
2023-03-21 12:39:58 CLIENT -> SERVER: QUIT
2023-03-21 12:39:58 SERVER -> CLIENT: 221 web.de Service closing transmission channel
Alles anzeigen