TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Solution: The server response was: 5.7.0 Must issue a STARTTLS command first. i16sm1806350pag.18 - gsmtp
Nitesh Kejriwal
May 01, 2015
90.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
This blog resolves a common error that occurs while sending emails using Gmail server
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!
Next Recommended Reading
Consuming JSON REST or RESTful Web Service's Response using .NET / C# Client
Rebin Infotech
Think. Innovate. Grow.