You may run into this error due to two reasons.
1. Older Nodemailer version
If you have installed an older version of Nodemailer, there may be outdated code in the library that can cause this error.
2. Invalid SMTP configuration
This error commonly occurs when connecting to the Microsoft SMTP server via Hotmail.
You may try the following to resolve the error.
1. Install the latest version of Nodemailer
Ensure that you are running on the latest version of Nodemailer. To do so, run the command shown below.
2. Verify SMTP configurations
Verify that you have provided the correct port, authentication type, username, and password in the SMTP configuration for Nodemailer. Additionally, if you use a service like Hotmail, Nodemailer provides an in-built service module with the required SMTP properties. Therefore, you only need to define the service you are using and the authentication credentials, while Nodemailer handles the SMTP configurations.
Consider the snippet below that lets Nodemailer automatically configure the Hotmail SMTP configuration.
View all errors