Windows App: Getting error sending email through Mailgun

Describe the issue/error/question

When trying to send email from the Windows app, after configuring a valid and connected SMTP server (smtp.mailgun.com) over port 25 and SSL/TLS enabled, I get an error.

Edit: In fact when trying the Slack app after I get authenticated through oAuth I get the same error when say getting channel details.

What is the error message (if any)?

Executing the node:

Error: Client network socket disconnected before secure TLS connection was established
    at connResetException (node:internal/errors:690:14)
    at TLSSocket.onConnectEnd (node:_tls_wrap:1577:19)
    at TLSSocket.emit (node:events:406:35)
    at TLSSocket.emit (node:domain:470:12)
    at endReadableNT (node:internal/streams/readable:1331:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Please share the workflow

{
“nodes”: [
{
“parameters”: {},
“name”: “Start”,
“type”: “n8n-nodes-base.start”,
“typeVersion”: 1,
“position”: [
240,
300
]
},
{
“parameters”: {
“fromEmail”: “[email protected]”,
“toEmail”: “[email protected]”,
“subject”: “test from n8n”,
“text”: “test”,
“options”: {}
},
“name”: “Send Email”,
“type”: “n8n-nodes-base.emailSend”,
“typeVersion”: 1,
“position”: [
460,
300
],
“credentials”: {
“smtp”: {
“id”: “1”,
“name”: “SMTP account”
}
}
}
],
“connections”: {
“Start”: {
“main”: [
[
{
“node”: “Send Email”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

Share the output returned by the last node

Information on your n8n setup

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

I tested to make sure port 25 can be accessed from my computer and it can.

Port 25 isnt common for ssl/tls. You sure the setup is correct?

1 Like

Yeah. I can try a few other ports but the slack app also sends the same error after configuration. I check my firewall and public and private access is on for the app.

1 Like

I tested the smtp config through and smtp checker online and email was delivered Over secure port 25 connection.

1 Like

Indeed the ssl / tls is port 465 only. But I still can’t get it to send email on port 25 using the windows app with ssl/tls off . Using self hosted works a charm.

With port 25/ssl-tls off on the windows app I get this now

“Converting circular structure to JSON → starting at object with constructor ‘Object’ — property ‘issuerCertificate’ closes the circle”

Seeing this works on your self-hosted n8n instance this could be a problem with your ISP - it’s not uncommon to block port 25 for private accounts.

Seeing you are using Mailgun you could consider using the Mailgun node instead of the SMTP one here.

If you want to use the Send Email/SMTP node without SSL instead, you can alternatively consider using port 587 instead of 25 with your Send Email credentials as this is also supported by Mailgun.

2 Likes

I’ll give the mailgun node a try. I did successfully connected to port 25 from power shell fine so it’s not my isp

On hosted instance I was able to get mailgun to work with my private API key (not the sending key for each domain by the way).

On app with the same config as hosted for mailgun node I get

“Converting circular structure to JSON → starting at object with constructor ‘Object’ — property ‘issuerCertificate’ closes the circle”

I am giving up on the app for now.