Server SMTP is not working

Hello Team,

I have the domain Before cloudflare PHP mail() function and SMTP of server was working fine.

$mail = new PHPMailer(true);
$mail->Host = ‘’;
$mail->SMTPAuth = true;
$mail->Username = ‘[email protected]’;
$mail->Password = ‘************’;
$mail->SMTPSecure = ‘SSL’;
$mail->Port = 25;

After Cloudflare connects domain is working fine and the PHP mail() function also working fine but SMTP mail is not working.

I configure DNS according to my research but it is not working. The mail subdomain is not proxy now.

But now I am getting some errors, check the below line.

SMTP Error: Could not connect to SMTP host.

What am I missing? Please help me ASAP.


With mail set to “DNS only”, your Cloudflare configuration is now correct. Check your mail server for any issues.

I can connect on port 25 but I’m not getting any response to SMTP commands.

telnet 25
Connected to
Escape character is '^]'.

I am getting following error, can you help me to resolve it.

2024-05-11 11:45:14 SERVER → CLIENT: 220-whm-cpanel.dhakdhakindia ESMTP Exim 4.97.1 #2 Sat, 11 May 2024 11:45:14 +0000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2024-05-11 11:45:14 CLIENT → SERVER: EHLO stagging.templatelelo
2024-05-11 11:45:14 SERVER → CLIENT: 250-whm-cpanel.dhakdhakindia Hello []250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPECONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2024-05-11 11:45:14 CLIENT → SERVER: STARTTLS
2024-05-11 11:45:14 SERVER → CLIENT: 220 TLS go ahead
SMTP Error: Could not connect to SMTP host.
2024-05-11 11:45:14 CLIENT → SERVER: QUIT
2024-05-11 11:45:14
2024-05-11 11:45:14
SMTP Error: Could not connect to SMTP host.

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