Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Solution: The server response was: 5.7.0 Must issue a STARTTLS command first. i16sm1806350pag.18 - gsmtp
WhatsApp
Nitesh Kejriwal
9y
91.4
k
0
0
25
Blog
Friends,
When sending emails via code using Gmail as mail server, we sometime get this error. This blog post explains the error and the solution to the same.
The error occurs when the code tries to authenticate Gmail server using the given credentials over non-SSL layer and does not encrypt the connection.
To resolve this, you need to set
EnableSsl
property of your SmtpClient class's object to true as mentioned below -
SmtpClient client =
new
SmtpClient(
"smtp.gmail.com"
);
client.EnableSsl =
true
;
Hope you like this. Keep learning and sharing! Cheers!
Up Next
Consuming JSON REST or RESTful Web Service's Response using .NET / C# Client
Ebook Download
View all
Coding Principles
Read by 2.5k people
Download Now!
Learn
View all
Rebin Infotech
Think. Innovate. Grow.
Membership not found