import nodemailer from "nodemailer"; export default function handler(req, res) { let transporter = nodemailer.createTransport({ host: "mail.wastpol.pl", port: 465, secure: true, auth: { user: "kontakt@wastpol.pl", pass: "jHP4oCaELy0EOhz5", }, }); let info = transporter.sendMail({ from: `"${req.body.name} 🤡" `, // sender address to: "kontakt@wastpol.pl", // list of receivers subject: `Wiadomość od ${req.body.name}`, // Subject line html: `Treść: ${req.body.msg}
Dane do kontaktu:
nr tel: ${req.body.tel}
mail: ${req.body.mail}

Wiadomość wygenerowana automatycznie na stronie wastpol.pl`, // html body }); res.status(200).json({ msg: "Message Sent" }); }