title: React nodemailer net.isIP is not a function
body: <p>I am trying to make a contact page with react and I'm struggling with sending the e-mail part.</p>
  
  <p>I'm trying to use <code>nodemailer</code>, and my code for that is:</p>
  
  <pre><code>var nodemailer = require('nodemailer');
  var xoauth2=require('xoauth2');
  var transporter = nodemailer.createTransport({
    service: 'gmail',
    auth: {
      xoauth2:xoauth2.createXOAuth2Generator({
        user: 'mymail@gmail.com',
          clientId: '',
          clientSecret: '',
          refreshToken:''
      })
    }
  });
  
  var mailOptions = {
    from: 'Name &lt;mymail@gmail.com&gt;',
    to: 'mymail@gmail.com',
    subject: 'Sending Email to test Node.js nodemailer',
    text: 'That was easy to test!'
  };
  
  transporter.sendMail(mailOptions, function(error, info){
    if (error) {
      console.log(error);
    } else {
      console.log('Email sent');
    }
  });
  </code></pre>
  
  <p>I have put the <code>clientId</code>, <code>clientSecret</code> and <code>refreshToken</code> from google API and oauth2 playground and enabled the non secure apps thing. But when I'm trying to send the e-mail I get<br>
  <strong>TypeError: net.isIP is not a function</strong></p>
  
  <p>EDIT: I have tried adding after <code>service: 'gmail'</code>       </p>
  
  <blockquote>
    <p>type: 'SMTP',
          host: 'smtp.gmail.com',</p>
  </blockquote>
  
  <p>Still not working</p>