Advertisement
Guest User

Untitled

a guest
Jun 29th, 2018
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var transporter = nodemailer.createTransport({
  2.     service: 'Gmail',
  3.     auth: {
  4.         user: 'iseppata2018principal@gmail.com', // Your email id
  5.         pass: 'Andre!2018!' // Your password
  6.     }
  7. });
  8.  
  9. var text = '\n\n' + '\nAlerta de Evento da plataforma PATA:\n\n' +
  10.     '\nEvento: ' + eventos[i].tipo + '\nData: ' + eventos[i].data +
  11.     '\nAnimal: ' + eventos[i].animal.nome +'\nVeterinário: ' + vet.name +
  12.     '\nEspecialidade: ' + dadosVet.especialidade + '\nMorada: ' + dadosVet.morada +
  13.     '\nContacto: ' + dadosVet.contacto + '\n\n\nCumprimentos da PATA';
  14.  
  15. var mailOptions = {
  16.     from: '<iseppata2018principal@gmail.com>', // sender address
  17.     //to: user.email, // list of receivers
  18.     to: "iseppata2018ec@gmail.com",
  19.     subject: 'Alerta de Evento PATA: '+ eventos[i]._id, // Subject line
  20.     text: text //, // plaintext body
  21. };
  22.  
  23. transporter.sendMail(mailOptions, function (error, info) {
  24.     if (error) {
  25.         console.log(error);
  26.     } else {
  27.         enviado = true;
  28.         console.log('Message sent: ' + info.response);
  29.     };
  30.     transporter.close();
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement