cannot connect to smtp.gmail.com
I am using google to send email from my system, I am new in linode
seems like it is blocking it.
using phpmailer
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->IsHTML(true);
error msg:
SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed. Mailer Error: SMTP connect() failed.
hope you can help…
3 Replies
As you mentioned you are new to Linode, you're likely encountering the SMTP restrictions that are in place by default for newer accounts. More information on these restrictions can be found here:
You'll need to configure rDNS for your Linode then open a Support ticket confirming CAN-SPAM compliance, and Support should lift the restrictions pretty quickly.
If this isn't the case, let us know so we can better assist.
As I was saying I am using gmail to send email not local mail.
using phpmailer
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->IsHTML(true);
error msg:
SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed. Mailer Error: SMTP connect() failed.
As @acacoilo mentioned, if you're attempting to send email from a Linode, and you have an account that was created after Dec 5th of 2019, then there will be SMTP filters in place to prevent this. For that to be removed, you'll want to open a ticket with Support: Tickets Page