Search code examples
phpdnsgmailphpmailer

Gmail not working with PHP integrated mail() for outgoing mails


We are having some major problems with the new gmail updates. Most of our page doesn't send mails anymore since our MX DNS is linked to Gmail. Now most of our functions that use PHP mail() does ONLY send e-mail every second mail. How come? Anyone experiencing the same issue?

Again, I can confirm that it works for every second mail I send, to certain emails. Not all.


Solution

  • Check if your mailer supports tls and if you are using SMTPSecure. Both are required by google to minimize spam.

    I highly recommend you using a mailer class such as PHP Mailer.

    A tutorial for gmail using PHP Mailer : https://github.com/PHPMailer/PHPMailer/blob/master/examples/gmail.phps