Through Cron, an automatic mass mailing of letters to users is set up every first day of the new month.

For some reason, the last time the situation was noticed that almost everyone who has mail is only on mail.ru/list.ru - the letters did not reach, although they were definitely sent through the mail() function.

In connection with this question - can I somehow receive and process the response of the remote server with the reason for which the letter was not delivered?

1 answer 1

Example from documentation

 <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> 

Over there, where From and Reply-To specify your email address and in general it will receive an e-mail from mail servers if they do not like something