MV Send an email from inside the game pt2

Hi to everyone!
So...I have something a little unusual to ask here, I guess-
Some times ago I implemented in my project a script capable of accessing a gmail dedicated account and sending an email from there
Spoiler: My previous thread about this

This is the code I used (still thanks to everyone who helped me):
Spoiler: Code
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: '[email hidden]',
pass: 'yourpassword'}});
var mailOptions = {
from: '[email hidden]',to: '[email hidden]',subject: 'subject',text: 'content'};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {console.log('Email sent: ' + info.response);}});

Everything was fine, but I recently noticed that gmail, starting May 30 2022, will no longer support the use of apps classified as less secure; I'm a little worried now about the fate of this feature.
If I am not mistaken, I will need to use OAuth2 authentication from that date on (or am I wrong?).
So my question is: is it possible to update the script? Someone can help?
Thank you 😍

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/send-an-email-from-inside-the-game-pt2.145943/