PHP mail() not sending on GoDaddy domain with DNS hosted here

Hi,

I have a domain, stridesforsuccess.com, registered with GoDaddy but the DNS is hosted with Cloudflare. I cannot send email to, for example, [email protected] from this domain from within a PHP script running on the server using shared hosting. The PHP function I am using is mail().

Is there specific documentation explaining how this all works and what needs to be done to effect it? I would like to learn something from this. Thank you

Any help will be appreciated.

Dion

Greetings,

Thank you for asking.

I am sorry to hear you are experiencing an issue with receiving/sending e-mails via your Website / PHP script while using Cloudflare services for your domain name.

Kindly, see below suggestions and tips for troubleshooting.

Usually, the MX record should point to a hostname such as mail , and the A (or CNAME ) type record for that hostname should be set to :grey: (DNS Only).

You might be using a hostname like yourdomain.com for your PHP script, which is :orange: (proxied) rather than the unproxied :grey: (DNS-only) like mail.yourdomain.com (possible this one not existing or is :orange: instead of being :grey:) at the DNS tab of Cloudflare dashboard, in your e-mail client for sending/receiving server (MS Outlook, Mozilla Thunderbird, etc.)

Could you re-check and re-write your PHP script?

Otherwise, I am successfully doing it via PHPMailer script as far as it has a lot of more options, and I can even connect to my external e-mail server provider (defining hostname, port, SSL/TLS settings, credentials, etc.) and send e-mails using it, while the website / script is hosted on another server.

Nevertheless, you might have to troubleshoot if the port like 25/465/587 is open at your GoDaddy hosting and contact GoDaddy to check this for you.

May I suggest checking below article if your e-mail records (usually the A mail and the MX record) are configured properly while you are using Cloudflare for your domain name:

I see your e-mail records are properly configured so far:

;QUESTION
stridesforsuccess.com. IN MX
;ANSWER
stridesforsuccess.com. 300 IN MX 0 smtp.europe.secureserver.net.
stridesforsuccess.com. 300 IN MX 10 mailstore1.europe.secureserver.net.

;QUESTION
mail.stridesforsuccess.com. IN A
;ANSWER
mail.stridesforsuccess.com. 300 IN A 3.130.60.26
mail.stridesforsuccess.com. 300 IN A 3.13.222.255
mail.stridesforsuccess.com. 300 IN A 3.13.246.91

I cannot find a DNS record for SPF/DKIM/DMARC.

Maybe you are missing some TXT/CNAME records (for SPF, DKIM, DMARC if so?)

I would also recommend looking into the below article due to further prevention of your e-mails being marked as a SPAM at the recipient’s side:

Nevertheless, using online tools on the links below you could test and troubleshoot more what is going on with your e-mails:

If you can, please check GoDaddy or your shared hosting server log files for any troubleshooting information.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.