Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29762

Google Security Alert With Node Mailer

$
0
0

I am having an issue with my portfolio site, which is currently coded using Node and Express. I am using Nodemailer with Google's SMTP for my contact form. My code is all working, my problem is actually with Google.

Sometimes the emails from my contact form will go through no problem. Other times, people will get an error because Google will send me a "Critical Security Alert" for my connected account (thus not allowing the SMTP to log in). I have already enabled less secure apps. I have searched for hours for an answer and cannot find one anywhere.

This is what my createTransport() function looks like (I have changed the email and password):

const smtpTrans = nodemailer.createTransport({    host: 'smtp.gmail.com',    port: 465,    secure: true,    auth: {        user: "example@gmail.com",        pass: "example"    }})

Anyone know how I can fix this?


Viewing all articles
Browse latest Browse all 29762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>