title: Unable to send Email using nodemailer in protractor.conf.js onComplete: function()
body: <p>Unable to send Email using nodemailer in protractor.conf.js onComplete: function(). Used the below code and it does not execute onComplete block</p>
  
  <pre><code>onComplete: function() {    
      var nodemailer = require('nodemailer');
      var transporter = nodemailer.createTransport({
          host: 'smtp.gmail.com',
          port: 465,
          secure: true, // use SSL
          auth: {
              user: 'email',
              pass: 'password'
          }
      });
      var mailOptions = {
              from: '"TestMail" &lt;&gt;', // sender address (who sends)
              to: 'receiver's email', // list of receivers (who receives)
              subject: 'Hello through conf', // Subject line
              text: 'Hello world ', // plaintext body
              html: '&lt;b&gt;Hello world &lt;/b&gt;&lt;br&gt; This is the first email sent with Nodemailer in Node.js', // html body
  
  
      };
  
          transporter.sendMail(mailOptions, function(error, info){
              if(error){
                  return console.log(error);
              }
  
              console.log('Message sent: ' + info.response);
          });
  </code></pre>