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
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 (DNS Only).
You might be using a hostname like yourdomain.com for your PHP script, which is (proxied) rather than the unproxied (DNS-only) like mail.yourdomain.com (possible this one not existing or is instead of being ) 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