Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Apps won't receive PHP mail() emails [closed]

From this support thread in google. I believe this is the problem :

"Because your website and your Google Apps email address share the same domain name, the mail agent running on the server that hosts your website thinks that it is responsible for mail addressed to your domain name. This is a typical default setting. When someone submits the form on your website, the mail agent recognizes your domain name and concludes that it should be sending mail to itself. The mail agent will attempt to deliver the message locally."

Where should I look at to resolve this, is it a PHP or Apache issue?

Thanks In advance

like image 607
Ríomhaire Avatar asked Mar 06 '26 09:03

Ríomhaire


1 Answers

You have two basic options:

  • Configure your sendmail (or replacement) to send all mail directly to Google's SMTP server with your account information. This is what the mail() function is using.
  • Skip sendmail and let PHP connect directly over SMTP to your Google SMTP account. Use a library like phpMailer to make it easy.
like image 153
Matt S Avatar answered Mar 08 '26 21:03

Matt S