0

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";

?>
A P
  • 75
  • 5
  • 2
    Fake From: headers trigger all types of spam detection rules. – mario Dec 09 '20 at 00:00
  • This is actively under monitoring by most email provider. As doing so, you are losing your server reeputaion and if you keep doing this they will flag your sever IP as spammer and most of your ougoing emails (even real one) will get block. – Louis Loudog Trottier Dec 09 '20 at 01:38

0 Answers0