title: Send Email using nodemailer
body: <p>I'm using nodemailer to send email in ReactJS. <br>I'm refering code from <code>https://www.w3schools.com/nodejs/nodejs_email.asp</code> and do the same. <br>But i got error: net.isIP is not a function</p>
  
  <p>Here is my code: </p>
  
  <pre><code>import React from "react";
  import nodemailer from "nodemailer";
  
  export default class App extends React.Component {
    componentDidMount() {
      var transporter = nodemailer.createTransport({
        service: "gmail",
        auth: {
          user: "xuanle.khtn@gmail.com",
          pass: "********",
        },
      });
  
      var mailOptions = {
        from: "xuanle.khtn@gmail.com",
        to: "leanhxuan_t59@hus.edu.vn",
        subject: "Sending Email using Node.js",
        text: "That was easy!",
      };
  
      transporter.sendMail(mailOptions, function (error, info) {
        if (error) {
          console.log(error);
        } else {
          console.log("Email sent: " + info.response);
        }
      });
    }
    render() {
      return &lt;div&gt;&lt;/div&gt;;
    }
  }
  </code></pre>
  
  <p>When i run app, i received the message from browser:</p>
  
  <pre><code>Uncaught TypeError: net.isIP is not a function
  at Object.push../node_modules/nodemailer/lib/shared/index.js.module.exports.resolveHostname (index.js:36)
  at SMTPConnection.connect (index.js:299)
  at index.js:263
  at index.js:70
  at run (setImmediate.js:40)
  at runIfPresent (setImmediate.js:69)
  at onGlobalMessage (setImmediate.js:109)
  </code></pre>
  
  <blockquote>
    <p>I'm newbie so i don't have any idea with this error. <br>How to
    resolve this problem?</p>
  </blockquote>