Hi imar thanks for the response. I want to use the hotmail smtp server as i always use hotmail. Ive followed the pages in chapter 9 carefully regarding sending email. The hotmail smtp server is: smtp.live.com.
---I have entered smtp.live.com as my network hosts as advised at beginning of page 309.
---Then at the top of page 310 in the page load handler i have entered my own email address for both ie email@example.com
---in the web.config i have entered firstname.lastname@example.org
and used smtp.live.com as my network host.
---Also i have set mySmtpClient.EnableSs1 to true. I put it right below
this in email.aspx.
---Ive also put my username and password attributes inside the <network host="smtp.live.com"> tag.
However i still got the following errors:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first
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.7.0 Must issue a STARTTLS command first
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
[SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first]
System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) +1061671
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) +101
System.Net.Mail.SmtpClient.Send(MailMessage message) +1480
Demos_Email.Page_Load(Object sender, EventArgs e) +169
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627