Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nodemailer = require('nodemailer');
- function sendMail() {
- const transporter = nodemailer.createTransport({
- service: 'Gmail',
- auth: {
- user: 'ggdb.info@gmail.com',
- pass: '<password>'
- }
- });
- const mailOptions = {
- from: 'ggdb.info@gmail.com',
- to: email,
- subject: 'test email',
- text: 'test test'
- };
- transporter.sendMail(mailOptions, function(error, info) {
- if (error) {
- console.log("Error while sending email.", error);
- }
- if (info) {
- console.log("info from sendMail: ", info);
- }
- console.log('email sent.');
- });
- }
- sendMail();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement