Cloudflare and WHM SMTP Connection


Dec 29, 2017
Rio de Janeiro
cPanel Access Level
Root Administrator

I am facing a issue with SMTP connections since I started to use cloudflare. I have a dedicated server and the main domain use cloudlflare. When I try to connect using a PHP SMTP script I have an issue if I try to connect to the secure SMTP server.

The point is simple, however I couldnt found a solution. As the default secure SSL/TSL server mail for WHM is in domain.tld, I cant connect directly because cloudflare is protecting this DNS. However if I disable cloudflare or use the insecure SMTP server that points to mail.domain.tld, I am able to connect perfectly.

So I need to find a way to move the secure SMTP server from the default domain.tld to a subdomain.domain.tld, however I dont know where I can change this setting. I already read some topics here that talk about this same issue, but couldnt find a solution. Someone already solved this?


Staff member
Apr 11, 2011

Is the PHP script located on the same server you are using to send out the email? If so, you could simply update the hostname setting in the PHP script to use "localhost". Otherwise, simply setup a new "A" record for the domain name (e.g. smtp.domain.tld) and then use that as the mail server name in your PHP script settings.

Thank you.