SMTP Setup

Describe the issue/error/question

Cannot send email. I’ve tried from a test workflow and sending invite for new members. I’ve tweaked the .env to SSL= false and true, port from 587 to 465, restarted the container but no avail.

What is the error message (if any)?

Error from invite members: Request failed with status code 504
Error from Workflow: Connection timeout

Please share the workflow

Vi .env file with SMTP settings
- N8N_EMAIL_MODE=smtp
- N8N_SMTP_HOST=mail.domain.tld
- N8N_SMTP_PORT=465
- [email protected]
- N8N_SMTP_PASS=passwordhere
- [email protected]
- N8N_SMTP_SSL=true

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:0.209.4
  • **Database you’re using (default: SQLite):SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hi @vics, welcome to the community :tada:

I am sorry you’re having trouble. Are there possibly any additional server logs that might help with understanding the problem? If not, can you confirm which email provider you are using so I can try and reproduce this issue?

In this topic you can also find a bunch of working configurations for a number of email providers which you might find helpful.

Hi @MutedJam,

Not sure where to find the logs. I’m using Docker on Ubuntu 22, if it helps. I am using an SMTP server on a shared hosting platform.
For other platforms, I am using SMTP ports 587/465 and same creds as n8n SMTP creds which both work, but not in n8n.

Please do let me know if you require any other info.

Hey @vics,

You mentioned error from worklfow… Are you trying the same credentials in the SMTP node? That could be the quickest way to debug what is going on.

If you are using TLS disable the SSL/TLS option if you are using SSL enable it, Once the credentials are in if you can share the error we should be able to work out what is going on. For example if the node returns a connection timed out message it could be that the container is having a hard time reaching the outside world properly or the response is very slow.

Found the issue, my VPS cloud provider had port 465 blocked and my SMTP doesn’t work on port 587. They uncloked port 465 and emails started going out. I have my docker compose file SMTP port set to 465 and SSL to true, all working.

Thanks for your help, all.

3 Likes

Oh wow, that’s a new one. I’ve seen port 25 blocked but not 465 until now. Glad to hear you figured it out, thanks so much for confirming!

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