Server Error in '/' Application.

The SMTP server requires a secure connection or the client was not authenticated. The server response was: Authentication required

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: Authentication required

Source Error:


Line 696:            Smtp.UseDefaultCredentials = false;
Line 697:            Smtp.Credentials = basicAuthenticationInfo;
Line 698:            Smtp.Send(mymailmsg);
Line 699:        }
Line 700:        public void SendMail(string msg, string email)

Source File: c:\inetpub\vhosts\memnagarjainsangh.com\httpdocs\App_Code\Library\Library.cs    Line: 698

Stack Trace:


[SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: Authentication required]
   System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) +2533041
   System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) +55
   System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) +126
   System.Net.Mail.SmtpClient.Send(MailMessage message) +2722
   AdvancedLibrary.Library.ErrorMsg(String pagename, String domain, String strerror) in c:\inetpub\vhosts\memnagarjainsangh.com\httpdocs\App_Code\Library\Library.cs:698
   Search_BirthDate.fillgrid() in c:\inetpub\vhosts\memnagarjainsangh.com\httpdocs\Search_BirthDate.aspx.cs:1238
   Search_BirthDate.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\memnagarjainsangh.com\httpdocs\Search_BirthDate.aspx.cs:95
   System.Web.UI.Control.OnLoad(EventArgs e) +109
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1590.0