The login is invalid due to a mismatch in the username and password, as error 535-5.7.8 indicates that they are not accepted.


Yes, your code is perfect. However, you need to enable access for less secure apps in your Google account to send emails. You can do this by following the link below:

Allow less secure apps from your Google Account


Google has recently disabled access for less secure apps. To continue using your app, you need to set up Login with app password.

In order to do this, you must enable two-factor authentication and create an app password for your Gmail account.

transport: {
  host: '',
  port: 465,
  secure: true,
  auth: {
    user: '',
    pass: 'app password',


Effective immediately, Google has discontinued the option to enable Less Secure App Access for Gmail accounts.

You can find detailed information about this change in the following link:

Read more interesting post

Leave a comment