Answer the question
In order to leave comments, you need to log in
Why do messages sent via mail() end up in spam?
Many times, on different projects, I noticed one thing that when sending an email message through the php mail() function, it will definitely end up in SPAM, with Google, Mail.RU, Rambler. What is it connected with? Maybe some additional headers to specify? piece of code below:
$to = $res['email'];
$subject = "Официальный ответ";
$message = '<html>
<head>
<title>Официальный ответ</title>
</head>
<body>
<span>
<b>Текст вашего обращения:</b><br>
</span>
<hr>
<h4>Официальный ответ</h4>
</body>
</html>';
$headers = "Content-type: text/html; charset=utf-8 \r\n";
$headers .= "От: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";
mail($to, $subject, $message, $headers);
Answer the question
In order to leave comments, you need to log in
mail uses sendmail or postfix on your machine.
If the machine ip does not have a ptr (DNS ptr, writeback, etc.) record, then the message will 100% be spammed, and the machine (ip) will be in the spam list
Solution here
Where can I find smtp not a local server for a developer?
You also need to dig towards the DKIM signature (DomainKeys Identified Mail). You can read a little about her here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question