1

I am currently developing a NodeJS server implementing the nodemailer package but I am facing issues about mails getting queued but not received.

Something to note is that my domain is registered at OVH and I have an MX Plan with a professional email with my domain name. My server is hosted on DigitalOcean and I can give more information later on if needed.

Here is how I am sending the email:

const transporter = nodemailer.createTransport({
    name: 'mydomain.com',
    host: ssl0.ovh.net,
    port: 465,
    secure: true,
    auth: {
        user: 'mail@mydomain.com',
        password: 'mypassword'
    }
})

const mailOptions = {
    from: {
        name: 'My name',
        address: 'mail@mydomain.com'
    },
    to: 'receiver@email.com',
    subject: 'New email',
    html: some_html_goes_here
}

transported.sendMail(mailOptions, (err, info) => {
    if(err) console.log(err)
    console.log(info)
})

After sending the email to the recipient this is the response that I get.

{
  accepted: [ 'receiver@email.com' ],
  rejected: [],
  envelopeTime: 222,
  messageTime: 57,
  messageSize: 22233,
  response: '250 2.0.0 Ok: queued as E2D4B1ED09376',
  envelope: { from: 'mail@mydomain.com', to: [ 'receiver@email.com' ] },
  messageId: '<ebf643b8-858d-18f0-c685-19f6626a4c51@mydomain.com>'
}

I don't know if I am doing something wrong but sometimes the email is received by the recipient and sometimes not.

Thanks to anyone who can help me!

Note: I don't know if it is worth mentioning that but I have a TXT record in my DNS Zone on OVH looking like this: mydomain.com. 0 TXT "v=spf1 include:mx.ovh.com ~all"

blouuuu
  • 454
  • 1
  • 4
  • 16
  • hi @CustyZ01, did you solve this problem? I am also facing same problem. – WebDev Jun 10 '21 at 08:06
  • Hello @WebDev sorry for the late answer. I asked in the OVH community and opened a new incident ticket but no one seemed to be able to help me. I decided to completly switch from OVH to Google Workspace and I manage to get everything work perfectly in less than an hour. My domain is still managed on OVH but emails aren't. I am planning to switch from OVH to Google Domains when it is available in my country (still in BETA version now). – blouuuu Jun 12 '21 at 00:23

0 Answers0