I recently ran into a problem where emails from this site were not being sent to my email hosted with Google Apps and were ending up marked as spam.
Firstly, if you are running your site on a cPanel server, you may need to have your web host edit some files locally on the server and have your domain listed in /etc/remotedomains. To find out if you need to do this, run the Email Delivery Route tool in cPanel and enter in your email address. If you see an error, or anything mentioning something like virtual_alias, then you will have to talk to your web host.
Finally, and this is the easy bit, you’ll need to add a record to your domains host records. You’ll need to go to where you have your domain hosted and edit the host records and add a new Text (or TXT) record and add the following piece of code:
v=spf1 a include:_spf.google.com ~all
What does all this mean?
| v=spf1 | This identifies the TXT record as an SPF string. |
| a | The server matching the a record is allowed to send mail for your domain. |
| include:_spf.google.com | Any server allowed to send email for Gmail, is also allowed to send mail for your domain. |
| ~all | SPF queries that do not match any other mechanism will return “softfail”. |
The last step that you may need to do is add a filter in Gmail if emails are flagged as spam. I had this problem, and a simple filter has it all sorted out. When you are setting up the filter, make sure to check the checkbox listed Never send it to Spam and your emails should end up in your inbox.
Note: All these steps listed above are what I have performed to have emails sent from this website to my Google hosted email. This is to be used as only a guide, and may be different for some users. If you have any questions, please feel free to leave a comment below.