title: Nodemailer SMTP not working on production server
body: <p>I am having issues sending email via nodemailer - SMTP(from another host) on production</p>
  
  <p>i uploaded my API on a server(Scaleway Dev), i'm using Ubuntu Bionic and while testing noticed it is not sending emails(which i need for verification of a user).</p>
  
  <p>at first i thought the request isn't getting to the server, but when i tried logging in i got a "confirm your password" response, i check the mongoDB database and the user is there, but still no confirmation email.</p>
  
  <p>I tried checking it on localhost, thinking it might be the dotenv dependency, but it works there, what gives?</p>
  
  <p>node version on my server is <strong>8.10.0</strong>
  and on my personal computer <strong>11.12.0</strong></p>
  
  <p>these are my dependencies</p>
  
  <pre><code>    enter code here
      "dependencies": {
  
      "bcrypt": "^3.0.6",
      "body-parse": "^0.1.0",
      "client-sessions": "^0.8.0",
      "connect": "^3.6.6",
      "cookie-parser": "~1.4.4",
      "cors": "^2.8.5",
      "debug": "~2.6.9",
      "dotenv": "^8.0.0",
      "express": "~4.16.1",
      "express-session": "^1.16.1",
      "express-validator": "^5.3.1",
      "http-errors": "~1.6.3",
      "moment": "^2.24.0",
      "mongoose": "^5.5.8",
      "morgan": "~1.9.1",
      "nodemailer": "^6.1.1",
      "nodemon": "^1.19.0",
      "passport": "^0.4.0",
      "pug": "2.0.0-beta11",
      "randomstring": "^1.1.5",
      "session": "^0.1.0",
      "session-mongoose": "^0.5.2"
  }
  </code></pre>
  
  <p>these options used are specified by the host that i'm using</p>
  
  <pre><code>//this is my transporter constant
  
      const transporter   = nodemailer.createTransport({
      host: '*different host from the server*',
      port: 465,
      secure: true,
      auth: {
          user: my used email(hardcoded),
          pass: process.env.EMAILPASS
      },
      tls: {
          rejectUnauthorized: false
      }
  });
  
  //my email options
  
      let mailOptions ={
                  from: '"Company Name &lt;noreply@*different host DNS*&gt;',
                  to: req.body.email,
                  subject: *subject*
                  html: `Email Content with confirmation token`
              }
  
  //emailing the message itself
  
      transporter.sendMail(mailOptions, (err, info) =&gt; {
                  if(err){
                      return console.log(err);
                  }
                  console.log("message sent");
              });
  
  </code></pre>
  
  <p>i'm using this email generator(<a href="https://generator.email/" rel="nofollow noreferrer">https://generator.email/</a>) for fast throwaway emails. the mailing starts after i save the user.</p>
  
  <p>I'm perplexed as to what should i do... any and all help is appreciated</p>