交易失败。服务器响应是:5.7.1伪造的HELO

时间:2016-01-07 14:04:25

标签: c# asp.net .net visual-studio

交易失败。服务器响应是: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>

1 个答案:

答案 0 :(得分:1)

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

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



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

因此,我在SMTP身份验证和发件人地址中使用了相同的email-id。