Fixing the Gmail SMTP problem in C#

Since May 2022, Google decided to drop support for “Less Secure Apps”. This means if your app is using SMTP, it will not work anymore. If you are looking for an easy fix to send e-mails from your .NET code again, keep reading!

An alternative to SMTP

If you have been using SMTP, you’ll have to refactor your application. You’ll need your code to use the Gmail API instead.

Using the Gmail API requires configuring your Google account in a certain way. The Gmail API leans on the OAuth 2.0 protocol heavily…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store