Question

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.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@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 ** mail@example.com root@test.example.com R=fail_remote_domains: The mail server could not deliver mail to mail@example.com. 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 root@test.example.com 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”