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:

https://www.linode.com/community/questions/19082/i-just-created-my-first-linode-and-i-cant-send-emails-why

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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct