How do I get my php contact form to work with Gsuite?

I am using Gsuite for email on my VPS. It is configured properly and works for sending and receiving emails except when I use the PHP form (again, setup properly). The functionality of the form itself works so I’m certain it’s something to do with the mail servers. The form submission emails aren’t being sent at all, not to any email address I use. How can I get this working? I know it has to do with PHP/mail servers/Gsuite but I don’t know beyond that.


hi i had the same problem just call godaddy and tell the essue they will sort it out the problem is gsuites and godaddy using the same domain so godaddy sends that mail to locally not to gsuites check the mx records updated properly

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@hansen I have followed both of those tutorials and haven’t been able to fix the problem. I need to use Cpanel/WHM for my needs and the default mail server is EXIM, disabling it may cause problems so I would like to stick with it if I can…

@hansen I want to use Exim if it will work properly on my server, but I’m open to sending directly from PHP with a framework via G Suite if you think that is better. I have tested my DNS pretty thoroughly and I haven’t found any problems with it which makes me think it’s my mail server relay. I would also like to add that I am using Cpanel/WHM on my server running CentOS 7

@hansen Here are some logs from EXIM:

“2017-08-04 14:19:11 1ddjzz-0004rm-II ** R=fail_remote_domains: The mail server could not deliver mail to The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 2017-08-04 14:19:11 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1ddjzz-0004rm-II 2017-08-04 14:19:11 1ddjzz-0004rr-O3 <= <> R=1ddjzz-0004rm-II U=mailnull P=local S=5559 T=“Mail delivery failed: returning message to sender” for 2017-08-04 14:19:11 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1ddjzz-0004rr-O3 2017-08-04 14:19:11 1ddjzz-0004rm-II Completed”

Thank you for the help, but I’m still not quite there with getting everything to work, I have the SMTP relay working now (no longer getting an error about that) but I’m still getting this error when submitting my PHP form email: (referring to the email address chosen to receive the email for the form) “The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.”

I’m using the G Suite via MX entries and Exim mail server is that is what you mean?

Here is what the error logs say:

Hi @cjoel

Without seeing any error logs, then it’s difficult to tell what’s going on, but a lot of new DigitalOcean accounts has SMTP blocked to prevent them from being used as spammers. Run this command to check if you’re being blocked from reaching Google’s SMTP:

telnet 25

If you cannot connect, then you need to create a ticket with Support in the control panel and ask to un-block SMTP.