I try to send e-mail from my web form at http://alpin52.ru I enter in the field Name Alex, Email alex@microsoft.com, Subject, Message are filled. Press send button.
Php script sendemail.php is executed. It takes address alex@microsoft.com and puts it to header from and reply-to. In mail() function "-f " parameter is specified, containing my domains email alex@iancaple.ru. I am not sure if it is totally correct since iancaple.ru is another domain name, hosted on the same VPS server.
When I test this case specifying address not alex@microsoft.com, but @gmail.com or @yandex.ru everything works. But for @microsoft.com the mail isn't delivered to address poas3@mail.ru as specified in sendemail.php Who blocks @microsoft.com addresses?
Here's my code:
<?php
// This is the script for sending email.
// change the email address below to your own email address.
$mailTo = 'poas3@mail.ru';
$name = htmlspecialchars($_POST['Name']);
$mailFrom = htmlspecialchars($_POST['Email']);
$subject = 'Message - '.htmlspecialchars($_POST['Subject']);
$message_text = htmlspecialchars($_POST['Message']);
$headers = "From: $name <$mailFrom>\n";
$headers .= "Reply-To: $name <$mailFrom>\n";
$message = $message_text;
mail($mailTo, $subject, $message, $headers, "-f ".$mailFrom );
echo "Sent";
?>