Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to send an email from my C# (Windows form application)

I got the error : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required

EnableSsl = true
smpt port = 587
host = smpt.gmail.com


C#
smtpClient.Send(msg); //Error come here


Thank in advance
Posted
Comments
Richard MacCutchan 15-Mar-13 5:31am    
Did you use a valid userid and password?
Manoj Chamikara 15-Mar-13 5:35am    
Richard MacCutchan Yes I'm 100% sure i'm using correct username and password
Prasad Khandekar 15-Mar-13 5:32am    
hello Manoj,

The gmail SMTP requires TLS/SSL connection which any way you seems to be using. The other most important thing is the Sender is required to authenticate him/her self using their gmail account before they are allowed to send/read emails. Try setting Credintials.


Regards,
Manoj Chamikara 15-Mar-13 5:37am    
Prasad Khandekar Thank you
I'm new to C# I'm not clear can you more explain
How to correct my error
Richard MacCutchan 15-Mar-13 5:44am    
Try a search of CodeProject, there hundreds of examples of this question complete with answers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900