title: (nodemailer)Google disabled the less secure app option on google accounts i would like to find a way to send email with google .Or any other way
body: <p><strong>I would like to find a way to send email from my app to the users either with some kind of google authentication or any other way...</strong></p>
  <pre><code>const nodemailer = require('nodemailer')
  
  const sendEmail = async options =&gt; {
  const transporter = nodemailer.createTransport({
      // host: &quot;smtp.gmail.com&quot;,
      // port: &quot;465&quot;,
      // secure: true,
      service:'gmail',
      auth: {
          user: &quot;USER_EMAIL&quot;,
          pass: &quot;USER_PASSWORD&quot;
      },
      tls:{rejectUnauthorized:false}
  })
  
  const message = {
      from: `${process.env.FROM_NAME} &lt;${process.env.FROM_EMAIL}&gt;`,
      to: options.email,
      subject: options.subject,
      text: options.message,
      html: options.message,
      attachments: [
          {
              filename: '.png',
              path: __dirname + '.png',
              cid: '.png'
          }
      ]
  }
  
  const info = await transporter.sendMail(message)
  console.log('Message sent : %s', info.messageId)
  console.log(__dirname)
  }
  module.exports = sendEmail
  </code></pre>
  <p><strong>It worked fine as long  as google had the less secure app option but since then i am struggling to find a way.</strong></p>