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:
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: