Error trying to use SendEmail

Describe the issue/error/question

I am trying to use the node SendEmail but it returns me an error. The problem is that I am not an expert configurating :frowning: and I have not idea about the error

What is the error message (if any)?

Please share the workflow

Share the output returned by the last 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)

Information on your n8n setup

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

Hey @franchogarcia, sorry to hear you’re having trouble here.

This could suggest a problem with your credentials, possibly the wrong port being used. Could you confirm which email provider you are using?

1 Like

Hello @MutedJam!
Due I want to sent an email using Outlook account, I have tryed with the next credentials:

  1. HOST: smtp.office365.com
    PORT: 587
    SSL/TLS: on
    With the previous credentials the error is the same:

  1. HOST: smtp.office365.com
    PORT: 465
    SSL/TLS: on
    With the previous credentials the error is the same:
    image

  2. HOST: smtp.office365.com
    PORT: 587
    SSL/TLS: off
    With the previous credentials the error is the same:

Error: Invalid login: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [LNXP265CA0024.GBRP265.PROD.OUTLOOK.COM]
    at SMTPConnection._formatError (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
    at SMTPConnection._actionAUTHComplete (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34)
    at SMTPConnection.<anonymous> (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:1490:18)
    at SMTPConnection._processResponse (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)
    at SMTPConnection._onData (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at TLSSocket.SMTPConnection._onSocketData (/private/var/folders/5b/0z88mwfd2339srrjkk1j8p7r0000gn/T/AppTranslocation/6520A75C-6EEF-4A29-8503-3D8EECD508D3/d/n8n.app/Contents/Resources/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)
    at TLSSocket.emit (node:events:394:28)
    at TLSSocket.emit (node:domain:470:12)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:226:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
  1. HOST: smtp.office365.com
    PORT: 465
    SSL/TLS: off
    With the previous credentials the error is the same:
    image

Hey @franchogarcia,

2 and 3 are both correct options one uses TLS and the other SSL, The problem is Microsoft is returning an error code which I have pasted below for you. It looks like Microsoft is saying you don’t have SMTP enabled, The link they have included in the error looks like it will guide you through the process of enabling it.

535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information.

An alternative option would be to use the Outlook node.

2 Likes

Thanks for your quick help!!
I am going to try it and if I resolve it with this info then I will tell you.

Thank you very much for your time and patient!
BR

2 Likes

I have tried it and it is running properly!!
Thx a lot as always you are the best @jon and @MutedJam!!

2 Likes