Advertisement
Guest User

Untitled

a guest
Nov 30th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // Before using this code below, setting your pop mail enable in your gmail account
  2.  
  3. var transport = nodemailer.createTransport("SMTP", {
  4. host: "smtp.gmail.com", // hostname
  5. secureConnection: true, // use SSL
  6. port: 465, // port for secure SMTP
  7. auth: {
  8. user: "your gmail",
  9. pass: "your password"
  10. }
  11. });
  12.  
  13. transport.sendMail({
  14. from: "Your name" <your@gmail.com>,
  15. to: "to1@gmail.com","to2@gmail.com",
  16. subject: 'Hello', // Subject line
  17. text: 'Hello world', // plaintext body
  18. }, function (error, response) {
  19. if (error) {
  20. res.send(error)
  21. } else {
  22. res.send(response)
  23.  
  24. }
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement