title: Nodemailer yahoo incorrect login
body: <p>I want to send emails from my NodeJs app.</p>
  
  <pre><code>const nodemailer = require('nodemailer');
  
  const senderMail = "myemail@yahoo.com";
  
  const emailTransporter = nodemailer.createTransport({
    service: 'yahoo',
    auth: {
      user: senderMail,
      pass: 'mypassword'
    }
  });
  
  function getMailReceivers(mailReceivers) { // convert the string array to one string
    var receivers = "";
  
    for (var i = 0; i &lt; mailReceivers.length; i++) {
      receivers += mailReceivers[i];
  
      if (i &lt; mailReceivers.length - 1)
        receivers += ", ";
    }
  
    return receivers;
  }
  
  function getMailOptions(mailReceivers, subj, content) { // set the options and return them
    return {
      from: senderMail,
      to: getMailReceivers(mailReceivers),
      subject: subj,
      html: content
    };
  }
  
  module.exports = {
    sendHtmlMail: function(mailReceivers, subject, html) { // send an email
      emailTransporter.sendMail(getMailOptions(mailReceivers, subject, html), function(error, info) {
        if (error) {
          throw error;
        } else {
          console.log(info.response);
        }
      });
    }
  };
  </code></pre>
  
  <p>So I use my <strong>correct login</strong>. I tested it multiple times. I still get this error message</p>
  
  <pre><code>Error: Invalid login: 535 5.7.0 (#MBR1212) Incorrect username or password.
      at SMTPConnection._formatError (...\nodemailer\lib\smtp-connection\index.js:591:19)
      at SMTPConnection._actionAUTHComplete (...\nodemailer\lib\smtp-connection\index.js:1320:34)
      at SMTPConnection._responseActions.push.str (...\nodemailer\lib\smtp-connection\index.js:356:26)
      at SMTPConnection._processResponse (...\nodemailer\lib\smtp-connection\index.js:747:20)
      at SMTPConnection._onData (...\nodemailer\lib\smtp-connection\index.js:543:14)
      at TLSSocket._socket.on.chunk (...\nodemailer\lib\smtp-connection\index.js:495:47)
      at emitOne (events.js:116:13)
      at TLSSocket.emit (events.js:211:7)
      at addChunk (_stream_readable.js:263:12)
      at readableAddChunk (_stream_readable.js:250:11)
  </code></pre>
  
  <p>There already is a question here but it got no answer yet</p>
  
  <p><a href="https://stackoverflow.com/questions/47580137/nodemailer-and-yahoo-failing-to-send-email">nodemailer and yahoo failing to send email</a></p>
  
  <p>I call my mailer by using this code</p>
  
  <pre><code>mailer.sendHtmlMail(["email1", "email2", "email3"], "Test Email", "&lt;p&gt;Success!&lt;/p&gt;");
  </code></pre>