initial commit of the sludge fest application using protonmail to do the
emailing with nodemailer
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
export async function load({ }) {
|
||||
console.log("sludge fest application")
|
||||
}
|
||||
|
||||
|
||||
export const actions = {
|
||||
default: async ({ request }) => {
|
||||
let data = await request.formData();
|
||||
console.log("apply", data);
|
||||
transporter.sendMail({
|
||||
from: SMTP_USERNAME,
|
||||
to: "fuckyou@sludge.link",
|
||||
subject: "This is a test",
|
||||
html: `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<h1>Hello email</h1 >
|
||||
</body>
|
||||
</html
|
||||
`
|
||||
}, (error, info) => {
|
||||
if (error) {
|
||||
console.error("Error sending email:", error);
|
||||
} else {
|
||||
console.log("Email sent successfully:", info.response);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
import { SMTP_TOKEN, SMTP_USERNAME } from '$env/static/private'
|
||||
import nodemailer from "nodemailer"
|
||||
const transporter = nodemailer.createTransport({
|
||||
service: "Proton",
|
||||
auth: {
|
||||
user: SMTP_USERNAME,
|
||||
pass: SMTP_TOKEN
|
||||
},
|
||||
authMethod: "PLAIN"
|
||||
} as nodemailer.TransportOptions)
|
||||
Reference in New Issue
Block a user