For the people using Google Apps for email, but having your host in other provider this are more detailed instructions for the people that is not very familiar with cPanel.
I could fix the problem of sending email from my domain using a PHP form, when sending the email to an account inside my domain.
i.e. mydomain.com Contact form sending email to [email protected].
The above was not working even if my domain has the correct MX records for the domain using Google Apps.
As Mike noted (and others) above the problem was solved: Adding the MX records into the cPanel.
- Enter into the cPanel
- Go the the cPanel Mail section
- Search for MX Entry Maintenance, sometimes there is no text above the icon.
- Select the related domain
- Change Email Routing to Remote Mail Exchanger.
- Add all the google MX records as they are in your domain configuration using the appropriate priority values.
You can check the records here and priorities
https://support.google.com/a/answer/174125
- Double check that Remote Mail Exchanger. is selected.
With this setting I was able to send email using mail PHP function to an email account inside the same domain as my website.
Google App instructions talking about MX records
https://support.google.com/a/answer/54717?hl=en
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…