Resolved: Gmail recipients are not getting emails sent using C#

In this post, we will see how to resolve Gmail recipients are not getting emails sent using C#

Question:

I had an working email sending functionality using c#. Suddenly gmail recipients are not getting the mails(neither in inbox nor spam). But other recipients (like outlook or any domain) are getting mails in their inbox. Here is my code:
However, I tried to manually send message from their Mail Application to a Gmail user. In that case the recipient is getting the mail. Mails only sent from the code to any gmail user is the main problem here. NB: I have already tried port:26, SmtpMail.UseDefaultCredentials = true. Still no luck

Best Answer:

In my case, google was considering my emails as spammy and blocked the emails for reducing the amount of spam sent to Gmail. Please visit https://support.google.com/mail/?p=UnsolicitedMessageError for more information

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com