Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Création de la méthode de transport de l'email
- let transport = nodemailer.createTransport({
- host: "smtp.mailtrap.io",
- port: 2525,
- auth: {
- user: "d060588dce3297",
- pass: "4e97fcc2cb515a"
- }
- });
- router.get("/askForCookiesRecipe", (req, res) => {
- transport.sendMail(
- {
- from: "26976c36b2-cfb955@inbox.mailtrap.io", // Expediteur
- to: "supergrandma@yopmail.com", // Destinataires
- subject: "Coucou cookie !", // Sujet
- text: "Donne la recette de cookie stp", // plaintext body
- html: "<b>Hello world ✔</b>" // html body
- },
- (error, response) => {
- if (error) {
- console.log(error);
- } else {
- res.send(response);
- }
- }
- );
- });
Add Comment
Please, Sign In to add comment