I am using following code to send email. The Code works correctly in my local Machine. But on Production server i am getting the error message
var fromAddres
You might need to create/generate a specific APP password from gmail. you app or script will then use this new password instead of your regular password. Your regular password will still work fine for you.
That is what did it for me. I still used the same email account but had to generate a new app specific password.
https://support.google.com/accounts/answer/185833?hl=en
Basically you can do it here: https://security.google.com/settings/security/apppasswords