nodemailer
nodemailer copied to clipboard
No Error, but gmail address not recefing email!
When I send the mail to a Gmail address it is not received. I heard that the name
is important for Gmail but I'm not sure what it must be.
It works with a none Gmail address without a problem.
Transporter:
const transporter = nodemailer.createTransport({
name: process.env.MAIL_NAME,
host: process.env.MAIL_URL,
port: 465, //587,
secure: true,
auth: {
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASS,
}
});
Send Mail:
const sendEmail = async (options:Mail.Options) => {
await transporter.sendMail(options, function (err, info) {
if (err) console.log(err)
else console.log(info)
})
}
sendEmail({
to: deal?.author.email || "",
from: process.env.MAIL_USER,
subject: `Neue Teilnahme anfrage von ${session.user.name}`,
text: emailText,
});
Thanks for your Help :)
@sempex
I have the same problem.
async sendSystem(to,subject,text,html){
if( !to ){ return; }
let info = await systemTransporter.sendMail({
from: `"Hitec Smart Home Server" ${process.env.MAIL_USERNAME}`,
to: to,
subject: subject | "",
text: text | "",
html: html | "",
});
console.log("Message info: ", info);
}
Debug message from console:
Message info: {
accepted: [ '[email protected]' ],
rejected: [],
envelopeTime: 321,
messageTime: 680,
messageSize: 233,
response: '250 2.0.0 OK 1664282285 k6-20020a50cb86000000b00456e98b7b7asm158097edi.56 - gsmtp',
envelope: { from: '[email protected]', to: [ '[email protected]' ] },
messageId: '<[email protected]>'
}
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.