Email: accept SMTP_FROM as "Name <address>"
The whole string was used as the address, so the mail server saw "Quorla support"@domain and rejected the sender. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e97bbd31f
commit
e905236f41
@ -27,7 +27,8 @@ function mailer() {
|
|||||||
});
|
});
|
||||||
return transport;
|
return transport;
|
||||||
}
|
}
|
||||||
const fromAddress = () => process.env.SMTP_FROM || process.env.SMTP_USER || "";
|
// SMTP_FROM may be "support@x.com" or "Quorla <support@x.com>"; nodemailer needs the bare address here.
|
||||||
|
const fromAddress = () => { const f = process.env.SMTP_FROM || process.env.SMTP_USER || ""; return (f.match(/<([^>]+)>/)?.[1] || f).trim(); };
|
||||||
export const appUrl = (p = "") => `${(process.env.PUBLIC_URL || (process.env.APP_DOMAIN ? `https://${process.env.APP_DOMAIN}` : "http://localhost:4310")).replace(/\/+$/, "")}${p}`;
|
export const appUrl = (p = "") => `${(process.env.PUBLIC_URL || (process.env.APP_DOMAIN ? `https://${process.env.APP_DOMAIN}` : "http://localhost:4310")).replace(/\/+$/, "")}${p}`;
|
||||||
|
|
||||||
const esc = (s) => String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
const esc = (s) => String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user