2

Our SMTP server is hosted on hostmonster. We are using nodemailer to send emails from our app to the users. The problem I am facing is that, I am getting 250 OK response from the SMTP server but the emails don't get delivered to the users. I am using the exact email configurations provided by the hostmonster. Our nodemailer configurations are:

var mailTransporter = nodemailer.createTransport({
host: "mail.domain.com",
port: 456,
secure: true,
auth: {
  user: "account@domain.com",
  pass: "password"
},
tls: {
        rejectUnauthorized: false,
     },
});

And the response I get:

{ accepted: [ 'email@domain.com' ],
  rejected: [],
  envelopeTime: 899,
  messageTime: 315,
  messageSize: 3464,
  response: '250 OK id="someid"',
  envelope:
   { from: 'account@domain.com',
     to: [ 'email@domain.com' ] },
  messageId: '<some-id@domain.com>' }

I expect the email to get delivered to the users (recipients) but it doesn't get delivered. Could anyone of you please verify my nodemailer configurations? Is there any issue with my nodemailer configurations? or Could there be any issue on the hostmonster side?

  • 1
    When you say, not delivered, do you mean not delivered or in spam folder? *Our SMTP server is hosted on hostmonster*. Is the smtp host their service or have you installed an smtp server on a vps they provide? also have you setup the PTR/SPF records for the domain? – Lawrence Cherone Oct 01 '19 at 14:08
  • @LawrenceCherone The emails do not get delivered at all. It's hosted on their service. – Abdul Rasheed Oct 01 '19 at 14:20
  • 1
    Should direct it to their support, most issues regarding setup mail just ends up in spam folder, or soft bounces.. If you're getting nothing (except server sucess) then only the person running the server can fix. – Lawrence Cherone Oct 01 '19 at 14:29
  • @LawrenceCherone I was missing an option in my nodemailer configuration (see my ans). Thank you very much for your time and suggestions :) – Abdul Rasheed Oct 03 '19 at 07:36

1 Answers1

3

Turned out, I need to add "name" option to the createTransport() configuration. The name should be the domain i.e. "www.domain.com".

var mailTransporter = nodemailer.createTransport({
name: "www.domain.com",
host: "mail.domain.com",
port: 456,
secure: true,
auth: {
  user: "account@domain.com",
  pass: "password"
},
tls: {
        rejectUnauthorized: false,
     },
});

Reference: https://github.com/nodemailer/nodemailer/issues/677