I am currently having a struggle sending an email from PHP:
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=utf-8\r\n";
$header .= "From: jan@example.com\r\n";
$header .= "Reply-To: jan@example.com\r\n";
$header .= "X-Mailer: PHP " . phpversion();
mail("receiver@example.org", "Subject", "Body", $header);
The problem is that on receiver side, the mail has the sender address xxx@example.net
(where example.net
is the host the PHP script runs on).
example.com
gets replaced by example.net
all the time. I'm running Plesk and PHP 8.0.3. Any ideas?