事务失败.服务器响应为:5.7.1伪造HELO
本文关键字:伪造 HELO 失败 服务器 响应 事务 | 更新日期: 2023-09-27 18:29:17
事务失败。服务器响应为:5.7.1伪造HELO。
描述:在执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误以及错误在代码中的来源的更多信息。
异常详细信息:System.Net.Mail.SmtpException:事务失败。服务器响应为:5.7.1伪造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>
我得到了同样的错误,我能够通过更改代码中的邮件设置来解决这个问题。事实上,我在中使用了不同的电子邮件id
msg.From = new MailAddress("******");
smtp.Credentials = new NetworkCredential("*********", "**********");
所以,我在SMTP身份验证和发件人地址中使用了相同的电子邮件id。