SMTP: extend env parsing (domain/auth/starttls); add unit test with mocked TLS for sendSmtpMail; extend SmtpConfig; docs to set .env locally

This commit is contained in:
Esdras Renan 2025-10-07 16:01:56 -03:00
parent 53c76a0289
commit 81fd572e48
3 changed files with 98 additions and 1 deletions

View file

@ -6,6 +6,7 @@ type SmtpConfig = {
username: string
password: string
from: string
tls?: boolean
}
function b64(input: string) {
@ -66,4 +67,3 @@ export async function sendSmtpMail(cfg: SmtpConfig, to: string, subject: string,
socket.on("error", reject)
})
}