Guest User

Untitled

a guest
Oct 24th, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. const nodemailer = require("nodemailer");
  2.  
  3. // Création de la méthode de transport de l'email
  4. var transport = nodemailer.createTransport({
  5. host: "smtp.mailtrap.io",
  6. port: 2525,
  7. auth: {
  8. user: "282a3d165de31e",
  9. pass: "be3b011087f729"
  10. }
  11. });
  12.  
  13. transport.sendMail({
  14. from: "Your sweetie grandchil <annelaure@wild.com>", // Expediteur
  15. to: "supergrandma@yopmail.com", // Destinataires
  16. subject: "Yo Grand Ma !", // Sujet
  17. text: "Can I get your cookie recipe please ? 🍪 I will cook you some of them !", // plaintext body
  18. html: "<p>Can I get your cookie recipe please ? 🍪</p>" // html body
  19. }, (error, response) => {
  20. if(error){
  21. console.log(error);
  22. } else{
  23. console.log("Message sent: " + response.message);
  24. }
  25. });
Add Comment
Please, Sign In to add comment