From 64f20921617835b33458fe911378ca27ee10055a Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 18 Dec 2025 21:08:04 +0000 Subject: website uses smtp --- website/src/actions/otp/send-otp.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'website/src/actions/otp') diff --git a/website/src/actions/otp/send-otp.ts b/website/src/actions/otp/send-otp.ts index b349feb..23f8dc0 100644 --- a/website/src/actions/otp/send-otp.ts +++ b/website/src/actions/otp/send-otp.ts @@ -1,9 +1,14 @@ import crypto from "node:crypto"; -import { SENDMAIL_BIN } from "astro:env/server"; import nodemailer from "nodemailer"; import { z } from "astro/zod"; import { defineAction } from "astro:actions"; import { db, Otp } from "astro:db"; +import { + SMTP_HOST, + SMTP_PASSWORD, + SMTP_PORT, + SMTP_USER, +} from "astro:env/server"; export default defineAction({ input: z.object({ @@ -46,6 +51,13 @@ to do anything.`, } const transporter = nodemailer.createTransport({ - sendmail: true, - path: SENDMAIL_BIN, + host: SMTP_HOST, + port: SMTP_PORT, + secure: false, + authMethod: "PLAIN", + auth: { + type: "login", + user: SMTP_USER, + pass: SMTP_PASSWORD, + }, }); -- cgit v1.2.3