Kijan pou m voye imèl ak Node.js?
asked 4 months ago383 viewsht
4
Mwen vle voye yon imèl konfimasyon lè yon moun enskri sou sit mwen an. Mwen eseye ak Gmail men li bloke m. Ki pi bon fason?
AI diagnosis
AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.
asked 4 months ago
Samuel Joseph 2.7k
1 Answer
8
✓✓ Accepted answer
Pa itilize yon kont Gmail pèsonèl pou imèl otomatik: Google ap bloke w, e imèl yo ap tonbe nan spam.
Itilize yon sèvis imèl tranzaksyonèl: Resend, Postmark, Amazon SES, Brevo… Pifò ladan yo gen yon plan gratis pou kòmanse.
Egzanp ak nodemailer sou SMTP yon sèvis konsa:
import nodemailer from 'nodemailer';
const transport = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: 587,
auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
});
await transport.sendMail({
from: 'DevPan <noreply@domen-ou.com>',
to: itilizate.imel,
subject: 'Konfime kont ou',
html: `<a href="${lyen}">Klike la a pou konfime</a>`,
});
Pou imèl yo pa tonbe nan spam, konfigire SPF, DKIM ak DMARC sou domèn ou an (sèvis la ba ou anrejistreman DNS yo).
Sign in to tell others whether this worked.
answered 4 months ago
David Charles 2.9k
Sign in and verify your email to post an answer.