Advertisement
Guest User

Untitled

a guest
Mar 5th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const nodemailer    = require('nodemailer');
  2.  
  3. const transporter = nodemailer.createTransport({
  4.     service: 'gmail',
  5.     auth: {
  6.         user: 'example@gmail.com',
  7.         pass: 'olo-lo'
  8.     }
  9. });
  10.  
  11. app.post('/form-data', (req, res) => {
  12.      var mailOptions = {
  13.                     from: 'example@gmail.com',
  14.                     to: 'example@gmail.com',
  15.                     subject: 'OLOLO',
  16.                     html: ``
  17.                 };
  18. });
  19.  
  20. transporter.sendMail(mailOptions, function(error, info){
  21.                     if (error) {
  22.                         console.log(error);
  23.                     } else {
  24.                         console.log('Email sent: ' + info.response);
  25.                     }
  26.                 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement