- I have my own registered domain.
- I have a dedicated IP for my domain.
- I use a shared hosting service for my website.
I want to send mail with php's function mail();. I have created one email account with my domain name.
The problem is that all the mail that I send using this function goes to the recipient's SPAM folder. I checked my domain name in several black lists but it's ok, it's not blacklisted.
When I send an email to a Gmail account, the next header appears:
info@mysite.com via cl02w01.xpress.com.mx (mysite.com is fictitious)
What should be the spf record for my domain? Considering that I have a dedicated IP, I use a shared hosting service which has a shared IP and that my mail is sent through cl02w01.xpress.com.mx according to Gmail.
UPDATE: I edited the SPF record for my site, it used to contain the dedicated IP address for my domain, it still contains my shared ip address because I'm using a cPanel wizard to create it and I can't remove it because it says the following:
The main server interface IP cannot be removed from this list if it is present. The following IP is the main server interface IP: xxx.xxx.xxx.xx
I don't understand this since I have a dedicated IP.
But now the messages are delivered in the recipient's inbox. I don't think just because I removed my dedicated IP address from the spf record now the messages are delivered correctly. Can someone explain this?
v=spf1 a mx -all- essentially saying that the only permitted senders of emails for your domain are servers matching the A records and MX records of your site, and deny all other IPs/domains. If you have more than one domain (or want to send emails using other servers) you will need to modify it, of course. (You may also be able to sign (DKIM) the emails using a script such as phpMailer) – cyberx86 Nov 11 '11 at 1:45