Use smtp client to send email without providing password
<p>I'm using nodemailer to try to send an email to myself via commandline:</p>
<pre><code>var nodemailer = require('nodemailer');

// config
var smtpConfig = {
    host: 'smtp.myhost.com',
    port: 465,
    secure: false, // dont use SSL
    tls: {rejectUnauthorized: false} 
};

// create reusable transporter object using the default SMTP transport
var transporter = nodemailer.createTransport(smtpConfig);

// setup e-mail data with unicode symbols
var mailOptions = {
    from: '&quot;Fred Foo &quot; &lt;foo@blurdybloop.com&gt;', // sender address
    to: 'person@gmail.com', // list of receivers
    subject: 'Hello ✔', // Subject line
    text: 'Hello world ', // plaintext body
    html: '&lt;b&gt;Hello world &lt;/b&gt;' // html body
};

// send mail with defined transport object
transporter.sendMail(mailOptions, function(error, info){
    if(error){
        return console.log(error);
    }
    console.log('Message sent: ' + info.response);
});
</code></pre>
<p>When I try to run this code I get the following error:</p>
<pre><code>Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8  https://support.google.com/mail/answer/14257
</code></pre>
<p>The link takes you to a page that tells you to register your app inside Google Console. But this is not what I'm trying to do.</p>
<p>There are loads of email clients that can send an email to a gmail inbox without having to sign into <em>that email account</em>. This is what I'm trying to do. I'm trying to turn my terminal into an smtp client that can send a mail message to any inbox. This shouldn't require extensive authentication. How do I do this?</p>
<h1>NOTE</h1>
<p>Just to provide some perspective, I'm trying to replicate in node whats possible with the unix <code>sendmail</code> command:</p>
<pre><code>sendmail person@gmail.com &lt; testemail.txt
</code></pre>
<p>How can I do this using nodemailer?</p>