Node Mailer SMTP Error

Describe the problem/error/question

Hi, I’m using a VPS server from Hostinger and have created an email account using the Virtualmin dashboard. I want to connect this email to the enquiry form on my website, so that when someone submits the form, the message is sent to my email.

However, I’m having trouble connecting to the SMTP server using Nodemailer

What is the error message (if any)?

Email error: Error: connect ETIMEDOUT IPADDRESS:587
at (Error: connect ETIMEDOUT IPADDRESS:587) {
errno: -60,
code: ‘ESOCKET’,
syscall: ‘connect’,
address: ‘IPADDRESS’,
port: 587,
command: ‘CONN’
} this the error message

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @vineethachari hope all is good. Welcome to the community.

Where did you get the values for smtp connection?

Hi @jabbson all good :smiley:. I received these values, such as the port number, from the Hostinger Support Team.

For that provider the port numbers have significance about the encryption protocol, 465 is for “SMTP over SSL” 587 is for STARTTLS, 2525 for TLS and 25 is for none. I would play around with the different switches and ports till you find a combination that works for you.

However, this is not a Hostinger email; this email was created on a VPS using Webmin/Virtualmin. That means inside the Virtualmin dashboard

for ileafdoors.com the mail server is mail.ileafdoors.com, so you can use that instead of an ip address 147.93.28.238. As for connecting via smtp - both ports 465 and 587 are open on this server. As for testing I cannot test it, obviously, without having credentials.

If you would like to create some credentials and share with me privately, I can test sending emails through this server.

1 Like

@jabbson I’ve already tried this, but I’m still getting the same error. How can I share the details with you privately?

Quick follow up, we spoke privately and figured the issue is with SSL certificate used by mail server was self-signed. @vineethachari will work on checking and fixing the certificate to a publicly trusted one (as ignoring self-signed certificate warnings is not an option for a good reason) and then re-test.