Connecting GMail account via SMTP node fails

Describe the problem/error/question

It’s not possible to set up a SMTP account with GMail credentials for the SMTP node. I first assumed it is because I installed n8n via a DigitalOcean droplet and DigitalOcean recently blocked SMTP ports. So I’ve set up another self-hosted n8n instance on another VPS (Hetzner) and it also fails. I tried with two different GMail accounts and made sure to follow the steps as outline in the (n8n docs), but I’m getting the same error message when providing the credentials (“connection timeout”). (I also tried different ports, 465 and 587, just to be sure). What could cause this issue?

What is the error message (if any)?

Connection timeout

Information on your n8n setup

  • n8n version: self-hosted
  • Database (default: SQLite): postgres
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker

Best way to send email with Gmail I think is to use Gmail node.
I’ve also tried with SMTP but couldn’t manage too.

SMTP is necessary in your workflow or you can switch to Gmail node?

It is possible to send emails via the GMail node, sure. But this does not explain why it’s not possible via the SMTP. Would be great to at least understand the issue.