使用 ASP.NET 发送邮件
我对 ASP.NET 比较陌生,如果这是一个新手问题,我很抱歉。我正在尝试使用 ASP.NET 发送电子邮件,但它不断抛出:
500 - 内部服务器错误。 您要查找的资源有问题,无法显示。
该错误在尝试实际发送邮件时发生。所以所有这些都工作正常:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
但是总是在这一行生成错误:
myMail.Send
那么什么可能导致这个问题呢?
I'm relatively new to ASP.NET so sorry if this is a newbie question. I am trying to send an email with ASP.NET but it keeps throwing a:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
The error occurs as the point in which the mail is attempted to actually send. So all of this works fine:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
But the error is generated at this line always:
myMail.Send
So what could be causing this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 ASP.NET,您最好使用 System.Net 中的
SmtpClient
类。For ASP.NET you would be better off using the
SmtpClient
class inSystem.Net
.为了更好地了解导致错误的真正原因,您可能需要取消选中浏览器中的“用户友好错误消息”。以下是在 Internet Explorer 中的操作方法
查看是否有可能对您有帮助的其他信息。
To get a better idea of what is really causing the error, you might want to uncheck the "user friendly error messages" in your browser. Here's how in Internet Explorer
See if you get any additional information there which might help you.