daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Apr 21st, 2018 321 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top