I want to send custom emails to musicians who perform on my radio program. Rather than using my web hosting provider’s email service, I’m considering using my Gmail account to send these messages directly from my .NET application.
Each email needs to be personalized for different bands and artists. I’m wondering if there’s a way to configure my .NET code to authenticate with Gmail’s SMTP server and send these customized emails programmatically.
Has anyone successfully implemented this approach? What would be the best method to accomplish this task?
Gmail’s SMTP is a pain with authentication - learned that the hard way. Skip app passwords and go straight to OAuth 2.0. Yeah, you’ll need to set up your app in Google Cloud Console and handle token refreshes, but it’s way more reliable.
Heads up: Gmail will throttle you even when you’re under the daily limit. I’ve hit delays during busy periods. For musician emails, batch your sends with small delays between each one - keeps the spam filters happy.
gmail smtp works great. just make sure you’re using the smtpclient class with the right creds. i had ssl cert issues and had to add servicepointmanager.servercertificatevalidationcallback to fix it. also, use sendmailasync instead of the regular send method - way better perf when sending multiple emails.
To use Gmail SMTP in your .NET application, you should enable 2-factor authentication on your Gmail account and generate an app password, as basic authentication is no longer supported. The SMTP server you’ll need is smtp.gmail.com, and you should configure it to use port 587 with SSL enabled. Keep in mind that Gmail limits you to approximately 500 emails per day for standard accounts, which may impact larger email campaigns. Additionally, it’s advisable to implement error handling and retry logic, as Gmail might reject connections during peak traffic.