nodemailer icon indicating copy to clipboard operation
nodemailer copied to clipboard

No Error, but gmail address not recefing email!

Open Sumis34 opened this issue 1 year ago • 1 comments

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 :)

Sumis34 avatar Sep 21 '22 19:09 Sumis34

@sempex

Sumis34 avatar Sep 21 '22 19:09 Sumis34

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]>'
}

zekageri avatar Sep 27 '22 12:09 zekageri

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 28 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 12 '22 02:11 github-actions[bot]