Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you must install npm install nodemailer
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'youremail@gmail.com',
pass: 'yourpassword'
}
});
var mailOptions = {
from: 'xxx@gmail.com',
to: 'xxx@gmail.com',
subject: 'Hello world!',
html: '<h1>Hello world!</h1><p>Hello all!</p>'
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K