Guest User

Untitled

a guest
Apr 21st, 2018
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // Création de la méthode de transport de l'email
  2. let transport = nodemailer.createTransport({
  3. host: "smtp.mailtrap.io",
  4. port: 2525,
  5. auth: {
  6. user: "d060588dce3297",
  7. pass: "4e97fcc2cb515a"
  8. }
  9. });
  10.  
  11. router.get("/askForCookiesRecipe", (req, res) => {
  12. transport.sendMail(
  13. {
  14. from: "26976c36b2-cfb955@inbox.mailtrap.io", // Expediteur
  15. to: "supergrandma@yopmail.com", // Destinataires
  16. subject: "Coucou cookie !", // Sujet
  17. text: "Donne la recette de cookie stp", // plaintext body
  18. html: "<b>Hello world ✔</b>" // html body
  19. },
  20. (error, response) => {
  21. if (error) {
  22. console.log(error);
  23. } else {
  24. res.send(response);
  25. }
  26. }
  27. );
  28. });
Add Comment
Please, Sign In to add comment