Initial commit with essential code files only

This commit is contained in:
2025-07-18 16:13:09 +02:00
commit 8e9b0ef8a8
33 changed files with 1703 additions and 0 deletions

26
pages/api/hello.js Normal file
View File

@@ -0,0 +1,26 @@
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} 🤡" <foo@example.com>`, // sender address
to: "kontakt@wastpol.pl", // list of receivers
subject: `Wiadomość od ${req.body.name}`, // Subject line
html: `<b>Treść:</b> ${req.body.msg}<br/>
<b>Dane do kontaktu:</b><br/>
<b>nr tel: </b>${req.body.tel}<br/>
<b>mail: </b>${req.body.mail}<br/><br/>
<i>Wiadomość wygenerowana automatycznie na stronie wastpol.pl</i>`, // html body
});
res.status(200).json({ msg: "Message Sent" });
}