O
O
Oleg2018-07-29 04:09:49
Email
Oleg, 2018-07-29 04:09:49

Mail goes to spam, how to change it?

Added the usual function to send a letter:

$to= "Mary <web-ifx[email protected]>"; 
$subject = "Birthday Reminders for August";
$message = 'TEST';
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
mail($to, $subject, $message, $headers);

I decided to check for spam through mail-tester. It shows 0/10 (even -2).
The most basic Error is: Return Address : [email protected] Although I installed FROM. The error is definitely not in the mail sending code.
And it also writes [SPF] example.com does not allow your myserverIP server to use [email protected]
I see the same errors if I send a letter to any mail server. For example on mail.ru. Then I go into the details of the letter and again I see discrepancies. It's like I'm sending mail on behalf of another domain. Even though I registered an email address.
How else to confirm that my server, domain and mail are one?
Installed centos on vds. Worth ispManager.
Set up all the necessary txt, CNAME, mx records with yandex on the domain
I added a domain via pdd.yandex.ru and confirmed it. Created a mail there. Added all necessary spf, DKIM signatures

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hell, 2018-07-29
@hell

First, try adding the correct 'Return-Path' header (which is just the return address), perhaps duplicating the return address itself through the -f additional parameter (that is, something like mail($to, $subject, $message, $headers , '[email protected]');) and see what happens.
Well, if you specify content-type text/html, it would be more correct to format the message in html (with html, head and body tags)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question