Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
You have to setup SMTP(simple mail transfer protocol). You can use package called nodemailer to do this easily. Read more: https://stackabuse.com/how-to-send-emails-with-node-js/
21st May 2020, 5:36 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
You can use nodemailer as 🔫 Rick Grimes mentioned. Or you can register an account in sendGrid, setup email api. https://sendgrid.com/solutions/email-api/ // Sample Node.js code const sgMail = require('@sendgrid/mail'); sgMail.setApiKey(process.env.SENDGRID_API_KEY); const msg = { to: 'test@example.com', from: 'test@example.com', subject: 'Sending with Twilio SendGrid is Fun', text: 'and easy to do anywhere, even with Node.js', html: '<strong>and easy to do anywhere, even with Node.js</strong>', }; sgMail.send(msg);
21st May 2020, 7:49 AM
Calviղ
Calviղ - avatar