© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
odqnger

❔ Getting error with sending an email in C# using gmail's smtp server.

Hi everyone. So I wanted to learn how to send an email using C# and I keep getting this error. I doubt it is something to do with my code and it might be a problem with my google account or something else. Nevertheless, I'll still send it here incase there is a problem in my code.

Here is the code:

This is the error message I am getting:

I've searched everywhere and every solution I try doesn't seem to work, so I've come here to see if there is any answer I can get. I've been working on this for about 2 hours so if you can, please send a solution ASAP.
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Sending email SMTP[Answered]
C#CC# / help
4y ago
How authenticate an SMTP connection using oauth2 for sending mail ( office 365) in c#?
C#CC# / help
2y ago
✅ Get Gmail inbox using C#
C#CC# / help
2y ago
❔ How do I change email senders avatar in smtp C#
C#CC# / help
4y ago