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.

75👍

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

12👍

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: 'smtp.gmail.com',
  port: 465,
  secure: true,
  auth: {
    user: 'contact@gmail.com',
    pass: 'app password',
  },
},

6👍

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:

https://support.google.com/accounts/answer/6010255?authuser=1&hl=en&authuser=1&visit_id=637902855221010844-2637605848&p=less-secure-apps&rd=1

Read more interesting post

Leave a comment