Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. router.get('/', function(req, res, next) {
  2. var transporter = nodemailer.createTransport({
  3. service: 'Gmail',
  4. //var info=info.response,
  5. auth: {
  6. user: 'xxxxx', // Your email id
  7. pass: 'xxxxx' // Your password
  8. }//auth
  9. });//transporter=nodemailer.create
  10.  
  11. var mailOptions={
  12. to: 'xxxxxx',
  13. subject: req.body,
  14. //subject: "lt",
  15. text: "Email Test Has Passed"
  16. }//mailOptions
  17.  
  18. transporter.sendMail(mailOptions, function (error, info, callback){
  19. if(error){
  20. console.log(error);
  21. res.json({yo: 'error'});
  22. }else{
  23. console.log('Message sent: ' + info.response);
  24. //console.log('info sent: ' + info);//[obj obj]
  25. infor=info.response;
  26. res.json({yo: info.response});
  27. };//else
  28. });//();//transporter.sendmail(mailoptions)
  29.  
  30. res.render('index', {
  31. title: 'laundrytake: we clean and deliver your laundry/dry cleaning',
  32. page:'Home',
  33. });//atw is a local var inside the temp index feeded from myArtwork
  34. });//router.get(/)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement