Email send through nodemailer goes into spam for gmail

Please get rid of the 👥 and try sending it again. I read in a article once that email clients don't like those icons because a lot of spammers are using them.

Try sending it to multiple gmail accounts. Other than that there's nothing wrong with the code. If you're on a shared hosting or local host it could also go into the junk folder. In that case you would have to look into sending the emails from a different IP, preferred in the same country as where you will send the emails to.

But first try to remove that icon!

PS. I would make this answer as a comment but I can't due to low rep.


The truth is there is no simple one line solutions for your problem :) There are numerous reasons why this can happen, and here are some of them:

  • Your host is marked as a spam - this happens if you have not verified your e-mail or you are sending too much e-mails from the same host. Shared hosting is commonly marked as such, and therefore mail server will regularly mark them as a spam

  • Your from field is different than the one you're allowed to use - as I see you're using smtp, there are strict rules for the mail you can send. Of course you can always send e-mail from [email protected], but since your SMTP's host is not facebook.com, your e-mail will pretty sure marked as spam

  • You can sign your e-mail in many various mails, assuring the servers that this e-mail is send from you and it has proper signature. Check online for the ways to do so.

  • While developing you have sent numerous alike e-mails - sending the very same "test" e-mail is a common reason for your e-mails to get blacklisted

  • There are emojis in your subject - that is not a 100% reason, but servers are often marking such e-mails as spams, especially in other fields (like from)

Unfortunately as I said there is no one real reason, there could be many of them. I hope this helps at least a little :)


in my case i needed to specify the form, the from need to be = to user mail

auth: {
  user: "[email protected]",
  pass: "password",
      }, 
from: [email protected],