View Single Post
  #5 (permalink)  
Old June 15th, 2012, 03:27 AM
Rajasekar1988 Rajasekar1988 is offline
Registered User
Points: 41, Level: 1
Points: 41, Level: 1 Points: 41, Level: 1 Points: 41, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar,
I did exactly what Ian told. I used port 587. but now i'm getting this error.

Server Error in '/' Application.
--------------------------------------------------------------------------------

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

Source Error:


Line 30:
Line 31: SmtpClient mySmtpClient = new SmtpClient();
Line 32: mySmtpClient.Send(myMessage);
Line 33: }
Line 34: }


Source File: c:\Users\Developer\Documents\Visual Studio 2010\WebSites\WebSite1\Demos\Email.aspx.cs Line: 32

Stack Trace:


[SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at]
System.Net.Mail.MailCommand.CheckResponse(SmtpStat usCode statusCode, String response) +1209995
System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) +41
System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +97
System.Net.Mail.SmtpClient.Send(MailMessage message) +1772
Demos_Email.Page_Load(Object sender, EventArgs e) in c:\Users\Developer\Documents\Visual Studio 2010\WebSites\WebSite1\Demos\Email.aspx.cs:32
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

And this is my new Web.config file settings
-----------------------------------------
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="my@gmail.com">
<network enableSsl ="true" userName="my@gmail.com" password="pwd" host="smtp.gmail.com" port="587"/>
</smtp>
</mailSettings>
</system.net>

Please help me to resolve this issue
Reply With Quote