title: Sending mail using nodemailer, need the steps
body: <p>I am new to <code>testcafe</code> and Node.js and I want to send mail using <code>nodemailer</code>. Can someone give me the steps? I tried few I am not sure if I am doing something incorrectly.</p>
  
  <p>Here are the steps that  followed:</p>
  
  <ol>
  <li>install nodemailer: <code>npm install nodemailer</code></li>
  <li>Create a Nodemailer transporter using either SMTP or some other transport mechanism</li>
  <li>Set up message options (who sends what to whom)</li>
  <li>Deliver the message object using the <code>sendMail()</code> method of your previously created transporter:</li>
  </ol>
  
  <pre class="lang-js prettyprint-override"><code>var mailer = require("nodemailer");
  
  var transporter = mailer.createTransport({
    host: "smtp.abc.email",
    port: 587,
    secure: false, // true for 465, false for other ports
    auth: {
      user: "email@abc.com", //
      pass: "password" //
    }
  });
  
  // send mail with defined transport object
  var mail = {
    from: "email@abc.com", // sender address
    to: "email@abc.com", // list of receivers
    subject: "hello", // Subject line
    text: "Hello world?", // plain text body
    html: "&lt;b&gt;Hello world?&lt;/b&gt;" // html body
  };
  
  transporter.sendMail(mail, function(error, response) {
    if (error) {
      console.log(error);
    } else {
      console.log("Message sent: " + response.message);
    }
  
    transporter.close();
  });
  </code></pre>
  
  <p>I have the following questions:</p>
  
  <ol>
  <li><p>For SMTP do I need to install anything from npm?</p></li>
  <li><p>Most of the examples in net shows Gmail, but I replace it with my company mail, I have considered here as <code>smtp.abc.com</code> do I need to do anything else?</p></li>
  <li><p>I want to send mail from my company email, what different setting is needed for that?</p></li>
  </ol>