DEV Community

Michael Burrows
Michael Burrows

Posted on • Edited on

Setup a contact form in React that sends email using Node.js

This article has move here.

Top comments (8)

Collapse
 
y1a2s3h4 profile image
Yash Purohit

Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 support.google.com/mail/?p=BadCred... o13sm2178229pfp.26 - gsmtp
at SMTPConnection._formatError (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:774:19)
at SMTPConnection._actionAUTHComplete (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:1513:34)
at SMTPConnection. (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:540:26)
at SMTPConnection._processResponse (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:932:20)
at SMTPConnection._onData (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:739:14)
at TLSSocket.SMTPConnection._onSocketData (F:\Contact Form\backend\node_modules\nodemailer\lib\smtp-connection\index.js:189:44)
at TLSSocket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at TLSSocket.Readable.push (_stream_readable.js:224:10) {
code: 'EAUTH',
response: '535-5.7.8 Username and Password not accepted. Learn more at\n' +
'535 5.7.8 support.google.com/mail/?p=BadCred... o13sm2178229pfp.26 - gsmtp',
responseCode: 535,
command: 'AUTH PLAIN'

i got this error

Collapse
 
reesharper profile image
Rees Harper

Google most likely blocked your login due to security concerns

Collapse
 
aktech profile image
Code Ware Technologies

Turning on less secure Apps solved this error for me. Good luck.
myaccount.google.com/lesssecureapps

Collapse
 
lucasglmt profile image
Lucas

Nice tutorial, thank you !

Collapse
 
iraqwarvet31 profile image
Larry

Great tutorial worked like a charm!!

Collapse
 
ddewzy profile image
ddewzy

localhost:3000 says message failed localhost:5000 says cannot GET/ how do i fix this?

Collapse
 
reesharper profile image
Rees Harper

Make sure you are using a post request.

Collapse
 
crokadilekyle profile image
Kyle

For me using "from: name" in the email sending was unsuccessful. I ended up changing it to "sender: email" and that worked.