0

My server uses the domain xxxx.com. I have a google Apps account associated with yy@xxxx.com. I've noticed recently that all the email sent by my server using PHP mail() from the address yy@xxxx.com to any email account managed by google (this includes gmail and google apps account) is not received. It used to be that it sometimes went into a spam folder, but now it just vanishes.

The problem does not affect the email addresses which are not run through google. I guess that google thinks that since it manages yy@xxxx.com, anything sent from somewhere else with this address is not legit. I've read here about folks having difficulties to send mail to yy@xxxx.com from their server when yy@xxxx.com is managed as a google apps, but my problem is more general: I cannot send to any account managed by google, e.g. zz@gmail.com

here's the basic php code:

$to      = 'zz@gmail.com';
$subject = 'test';
$message = 'this is a test';
$headers = 'From:  yy@xxxx.com' . "\n" .
'Reply-To: yy@xxxx.com' . "\n" .
'Return-Path: yy@xxxx.com';

mail($to, $subject, $message, $headers);

I've also added (with no change in results) "X-Mailer: PHP/" . phpversion()

Any suggestions ?

1 Answers1

2

You should send authenticated mail.

If you claim you are sending mail from an account that is hosted on that server, it will attempt to verify that it was actually sent from their servers. When it finds that did not happen, then it will likely be trashed/spam foldered/held/or just nuked to dev>null .

See my code written on this StackOverflow thread >>

How to authenticate with SMTP using phpMailer

Community
  • 1
  • 1
Kraang Prime
  • 9,981
  • 10
  • 58
  • 124