发送电子邮件时出错 [英] error while sending an email

查看:221
本文介绍了发送电子邮件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'/ email''应用程序中的服务器错误。



根据验证程序,远程证书无效。



描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。



异常详细信息:System.Security.Authentication.AuthenticationException:根据验证程序,远程证书无效。



来源错误:





第35行:smtp.EnableSsl = true;

第36行:smtp.Send(mail);

第37行:

解决方案

在web.config中插入代码

 <   system.net  >  
< 设置 >
< servicePointManager checkCertificateName = true checkCertificateRevocationList = false / >
< / settings >
< / system.net > ;


Server Error in ''/email'' Application.

The remote certificate is invalid according to the validation procedure.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Source Error:


Line 35: smtp.EnableSsl = true;
Line 36: smtp.Send(mail);
Line 37:

解决方案

insert code in web.config

<system.net>
    <settings>
      <servicePointManager checkCertificateName="true" checkCertificateRevocationList="false" />
    </settings>
  </system.net>


这篇关于发送电子邮件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆