tweak to working details

This commit is contained in:
2024-05-27 17:37:24 +00:00
parent e70c6736f6
commit 7e543aebc0
6 changed files with 37 additions and 19 deletions

View File

@@ -1,26 +1,32 @@
'use server';
import { createTransport } from "nodemailer";
import SMTPTransport from "nodemailer/lib/smtp-transport";
import { env } from "../../env.mjs"
export async function submitMessage({ from, text }: { from: string, text: string }) {
// const transport = createTransport({
// host: "unknown",
// port: 0,
// auth: {
// user: env.SMTP_USER,
// pass: ""
// },
const options = {
host: env.SMTP_HOST,
port: 587,
auth: {
user: env.SMTP_USER,
pass: env.SMTP_PASS,
},
} as SMTPTransport.Options;
// console.log({ options });
// const transport = createTransport(options);
// const result = await transport.sendMail({
// subject: "Contact Form Submission | mikayla.dev",
// to: env.SMTP_USER,
// to: env.SMTP_TO,
// from,
// text,
// } as SMTPTransport.Options);
// });
// const result = await transport.sendMail(sendMailOptions)
// const failed = result.rejected.concat(result.pending).filter(Boolean);
// if (failed.length) {
// throw new Error("Failed to send email verification");
// }
}