以下是我在学习过程中出现的错误,就是不知道如何配置本机那个SMTP。搞了很长时间,还未搞定。
我查了本坛上的passwordRecovery这个关键字。解决了或有好办法,烦请通知:[email protected]
在邮件标头中找到无效的字符。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.FormatException: 在邮件标头中找到无效的字符。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
[FormatException: 在邮件标头中找到无效的字符。]
   System.Net.BufferBuilder.Append(String value, Int32 offset, Int32 count) +159
   System.Net.Mail.EHelloCommand.PrepareCommand(SmtpConnection conn, String domain) +54
   System.Net.Mail.EHelloCommand.Send(SmtpConnection conn, String domain) +13
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +665
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +164
   System.Net.Mail.SmtpClient.GetConnection() +37
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1228[SmtpException: 发送邮件失败。]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1552
   System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +375
   System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView() +525
   System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword() +72
   System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object source, EventArgs e) +86
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +89
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +158
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2863