I'm implementing a "no-reply" account for sending automated emails. Do I need the access key/refresh token, and if so where can I generate them for a service account?
At the moment I have this:
noreply = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
type: 'OAuth2',
user: smtpConfig.client_email,
serviceClient: smtpConfig.client_id,
privateKey: smtpConfig.private_key,
}
});
Which unfortunately gives me this:
{ Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials h81sm3513839itb.18 - gsmtp
at SMTPConnection._formatError
...
Thanks!