title: Error: Hostname/IP doesn't match certificate's altnames node.js
body: <p>i want tom send email from my application using nodemailer , my code looks like this :</p>
  
  <pre><code>var smtpTransport = nodemailer.createTransport(smtpTransport({
            pool: true,
          host: 'smtp.myemailserver.com',
          port: 587,
          auth: {
              user: 'user@myDomain.com',
              pass: '******'
          }
  }));
  var mailOptions = {
      from: 'user@myDomain.com',
      to: 'user2@gmail.com',
      subject: 'test ',
      text: 'Hello world ',
      html: '&lt;b&gt;Hello world &lt;/b&gt;'
      };
  
  smtpTransport.sendMail(mailOptions, function(error, info){
      if(error){
         console.log(error);
      }else{
      console.log('Message sent: ' + info.response);
      }
  });
  </code></pre>
  
  <p>but i get error that i can't figure out  :</p>
  
  <pre><code> [Error: Hostname/IP doesn't match certificate's altnames: "Host: smtp.myemailserver.com. is not in the cert's altnames: DNS:secure.emailsrvr.com, DNS:www.secure.myemailserver.com"]
        reason: 'Host: smtp.myemailserverr.com. is not in the cert\'s altnames: DNS:secure.myemailserver.com, DNS:www.myemailserver.com',
        host: 'smtp.myemailserver.com.',
        cert: 
         { subject: { OU: [Object], CN: 'secure.myemailserver.com' },
           issuer: 
            { C: 'GB',
              ST: 'Greater Manchester',
              L: 'Salford',
              O: 'COMODO CA Limited',
              CN: 'COMODO RSA Domain Validation Secure Server CA' },
           subjectaltname: 'DNS:secure.emailsrvr.com, DNS:www.secure.myemailserver.com',
           infoAccess: { 'CA Issuers - URI': [Object], 'OCSP - URI': [Object] }
  </code></pre>
  
  <p>i tried to add</p>
  
  <pre><code>tls { 
  rejectUnauthorized: false 
  } 
  </code></pre>
  
  <p>to email option but that causes blocking my email , so please any help </p>