diff --git a/memento-note/lib/mail.ts b/memento-note/lib/mail.ts index 409180f..3ab6222 100644 --- a/memento-note/lib/mail.ts +++ b/memento-note/lib/mail.ts @@ -61,8 +61,9 @@ async function sendViaResend(apiKey: string, { to, subject, html, attachments }: const { Resend } = await import('resend'); const resend = new Resend(apiKey); - const from = process.env.NEXTAUTH_URL - ? `Memento ` + const hostname = process.env.NEXTAUTH_URL ? new URL(process.env.NEXTAUTH_URL).hostname : ''; + const from = hostname && hostname !== 'localhost' + ? `Memento ` : 'Memento '; // Resend supports attachments with inline content