title: Nodemailer error: verification email doesn't works
body: <p>I am writing this code to sign up the user.
  I used <strong>Nodemailer</strong> to send a verification email to activate the account.
  The post request works well but I did not receive a verification email and here is my code:</p>
  <pre><code>const transporter = nodemailer.createTransport({
      service: &quot;Gmail&quot;,
      auth: {
          user: process.env.EMAIL_USERNAME,
          pass: process.env.EMAIL_PASSWORD,
      },
  });
  
  exports.signup = async(req, res) =&gt; {
      const { email } = req.body
         
      if (!email) {
          return res.status(422).send({ message: &quot;Missing email.&quot; })
      }
      try {
         
          const existingUser = await User.findOne({ email }).exec();
          if (existingUser) {
              return res.status(409).send({
                  message: &quot;Email is already in use.&quot;
              });
          }
        
          const user = await new User({
              _id: new mongoose.Types.ObjectId,
              email: email
          }).save();
          
          const verificationToken = user.generateVerificationToken();
        
          const url = `http://localhost:5000/api/verify/${verificationToken}`
          transporter.sendMail({
              to: email,
              subject: 'Verify Account',
              html: `Click &lt;a href = '${url}'&gt;here&lt;/a&gt; to confirm your email.`
          })
          return res.status(201).send({
              message: `Sent a verification email to ${email}`
          });
      } catch (err) {
          return res.status(500).send(err);
      }
  }
  </code></pre>
  <p><strong>WHEN I SEND THE REQUEST, SHOWS ME LIKE THIS</strong></p>
  <p><a href="https://i.stack.imgur.com/xL1eN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xL1eN.png" alt="enter image description here" /></a></p>