title: TypeError: nodemailer.createTransport is not a function
body: <p>I am trying to implement nodemailer in my nodejs app to send emails.</p>
  
  <p>Here is my code</p>
  
  <pre><code>var express = require('express');
  var nodemailer = require('node-mailer');
  
  var app = express();
  app.post('/contact/send', function(req, res) {
  var transporter = nodemailer.createTransport({
      service: 'Gmail',
      auth: {
          user: 'myEmailIdHere',
          pass: 'myPassword'
      }
  });
  
  var mailOptions = {
      from: 'myName &lt;myEmailIdHere&gt;',
      to: 'myOtherEmailIdHere',
      subject: 'Website Submission',
      text: 'You have a submission with the following details... Name: ' + req.body.name + ' Email: ' + req.body.email + ' Message: ' + req.body.message,
      html: '&lt;p&gt;You have a submission with the following details...&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Name: ' + req.body.name + '&lt;/li&gt;&lt;li&gt;Email: ' + req.body.email + '&lt;/li&gt;&lt;li&gt;Message: ' + req.body.message + '&lt;/li&gt;&lt;/ul&gt;'
  };
  transporter.sendMail(mailOptions, function(error, info) {
      if (error) {
          console.log(error);
          res.redirect('/');
      } else {
          console.log('Message Sent: ' + info.response);
          res.redirect('/');
      }
  })
  </code></pre>
  
  <p>After submitting the form, i am getting the error as</p>
  
  <p>"TypeError: nodemailer.createTransport is not a function"</p>
  
  <p>Can someone help me figure out how to make the code work with nodemailer?</p>