【发布时间】:2016-01-07 14:04:25
【问题描述】:
交易失败。服务器响应为:5.7.1 Forged HELO。
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.Net.Mail.SmtpException:事务失败。服务器响应为:5.7.1 Forged HELO。
Session["New"] = TextBox1.Text;
MailMessage msg;
string ActivationUrl = string.Empty;
string emailId = string.Empty;
msg = new MailMessage();
SmtpClient smtp = new SmtpClient();
emailId = TextBox1.Text.Trim();
msg.From = new MailAddress("******");
msg.To.Add(emailId);
msg.Subject = "Confirmation E-mail";
msg.Body = str2;
msg.IsBodyHtml = true;
smtp.Credentials = new NetworkCredential("*********", "**********");
smtp.Port = 25;
smtp.Host = "***********";
smtp.EnableSsl = false;
smtp.Send(msg);
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Confirmation Link to activate your account has been sent to your email address');", true);
Response.Redirect("Successfull.aspx");
我的 web.config 文件
<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="server=***.**.***.**;Database=***********;Integrated Security=false;Uid=**********;Pwd=**********;" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Server=***.**.***.**;Database=************;User ID=*****************;Password=*****************;" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.web>
<machineKey validationKey="**************************************" decryptionKey="****************************************************" validation="****" decryption="***" />
</system.web>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
【问题讨论】:
-
你用的是什么邮件服务器?
-
您确定您的服务器上没有 SSL/TLS 吗?
标签: c# asp.net .net visual-studio