E
E
Eugene M2019-02-12 11:16:38
gmail
Eugene M, 2019-02-12 11:16:38

Not receiving mail on gmail?

If you send a letter from my [email protected] mailbox directly to gmail, it will come. And if through the verification script, then it gets into spam:

<?
  ini_set( 'display_errors', 1 );
  error_reporting(E_ALL & ~(E_NOTICE | E_STRICT));
  $from = "[email protected]";
  $to = "mррмр@gmail.com"; //сюда вписать ящик, на который нужно отправить письмо
  $subject = "PHP Mail Test script";
  $message = "This is a test to check the PHP Mail functionality";
  $headers = "From:" . $from;
  if (mail($to,$subject,$message, $headers))
     echo "Test email sent";
  if (mail($to,$subject,$message, $headers, 'f'.$from))
     echo "Test email sent with extraParams";
?>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene M, 2019-02-13
@hotwind

In my case, it was necessary to register the domain in \etc\postfix\main.cf and everything worked, the postfix mail server was installed.

K
ky0, 2019-02-12
@ky0

Obviously, because you send "directly" by logging in to Google's SMTP, and from a script - from your server, probably also SPF / DKIM / reverse zone is not configured.

D
Dimonchik, 2019-02-12
@dimonchik2013

https://www.mail-tester.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question