【问题标题】:Transaction failed. The server response was: 5.7.1 Forged HELO交易失败。服务器响应为:5.7.1 Forged HELO
【发布时间】: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


【解决方案1】:

我遇到了同样的错误,我可以通过更改代码中的邮件设置来解决问题。实际上,我在以下位置使用了不同的电子邮件 ID:


msg.From = new MailAddress("******");



smtp.Credentials = new NetworkCredential("*********", "**********");

所以,我在 SMTP 身份验证和发件人地址中使用了相同的电子邮件 ID。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-14
    • 2015-03-06
    • 2017-10-14
    • 1970-01-01
    • 2017-11-24
    • 1970-01-01
    • 1970-01-01
    • 2016-12-29
    相关资源
    最近更新 更多