I am working with phpmailer to send my clients a confirmation mail. I am sending my mails vai gmail smtp to other gmail id. Before adding my site to cloudflare, mails were working great and on wapm localhost too but not after adding to cf it’s saying “Error SMTP: could not connect to smtp host”.
here is my code : -
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = "smtp";
$mail->SMTPDebug = false;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Host = "smtp.gmail.com";
$mail->Username = $emailusername;
$mail->Password = $emailpassword;
$mail->IsHTML(true);
$mail->AddAddress($emailtousername, $emailtoname);
$mail->SetFrom($emailusername, $emailfromname);
$mail->Subject = $career_subject;
$content = '<html>html code</html>';
$mail->MsgHTML($content);
if(!$mail->Send()) {
} else {
}
please help me with this issue!
fritex
July 5, 2021, 6:43pm
#2
Is the return address of your mail from a @gmail (or your own G-Suite domain) address?
May I ask have you checked similar topics for some help regarding PHPMailer?:
I have implemented the classic phpmailer (https://github.com/PHPMailer ) to send emails from my website. It works fine on the localhost and on another web server in the cloud. But my virtual server in the Oracle Cloud has its name resolution on Cloudflare. The DNS A records are not proxified. The MX records point to the gmail mail servers, and hence, all normal email in and out it running fine. Just the php script in my web page on this exact web server can’t connect to the Google SMTP servers. I…
I use a PHP script to send group emails to all my customers. Everything was working fine till 9th April 2021. But, suddenly from 10th April Night, the mails are not getting delivered to my customers. I haven’t changed any code or DNS record. With the same codes and DNS records, everything was working just fine a day ago.
My website is hosted on Godaddy and the Nameservers are on Cloudflare. I have raised a support ticket with Cloudflare for which I am yet to get a response. I contacted Godaddy …
i’ev checked every tutorial but got nothing. i’ev just created two different gmail id’s and want to send mail from one to another, that’s it.
fritex
July 5, 2021, 7:12pm
#4
Well, may I ask if PHP mail()
function or sendmail()
is defined and actually working on your hosting?
Which versioin of PHPMailer are you using?
What do you get when true
for SMTPDebug
?
pratikgt82:
wapm localhost
Running locally on a home network or?
If so, are the needed ports open and the (sub)domain (un)proxied via Cloudflare? ( or cloud depending on the needs)
This tutorial covers the steps you should take if, when you change your domain to point to Cloudflare, you no longer receive emails to your domain. If you follow this tutorial and still need further help, please let us know what you have tried and share your domain name and, if possible, a redacted screenshot of your DNS records in Cloudflare.
[Cloudflare Community Tutorial - Troubleshooting Email Delivery Issues]
1. Do you have the correct MX records set for your domain?
You will…
https://support.cloudflare.com/hc/en-us/articles/200168876-Email-undeliverable-when-using-Cloudflare
system
closed
July 20, 2021, 7:13pm
#5
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.