title: Why email is not receving if sent successfully using nodemailer in node js?
body: <pre><code>import nodemailer from &quot;nodemailer&quot;;
  
  // transporter object
  const transporter = nodemailer.createTransport({
      host: &quot;smtp.gmail.com&quot;,
      port: 587, 
      secure: false, // true then port will change
      requireTLS:true,
      auth: {
          user: &quot;mygmail@gmail.com&quot;, 
          pass:&quot;myapppassword&quot; //google app password
      }
  })
  
  // mail object
  const mailOptions = {
      name:&quot;hello&quot;,
      from: &quot;my@gmail.com&quot;,
      to: &quot;myfriend@gmail.com&quot;, //allowed comma separated mutiple emails
      subject: &quot;Node js mail text&quot;,
  
      text: &quot;hello buddy aapke father aaye hain!&quot;
  }
  
  // send mail
  transporter.sendMail(mailOptions, (err, res) =&gt; {
      if (err) {
          console.log(err)
      } else {
          console.log(res.response)
      }
  })
  </code></pre>
  <p>In the above code snippet i tried send text email to another account and it is sent successfully but i am not receiving the email but when i try to send the email to the same email it is getting inside the inbox , why it is happening ? Thank you</p>