发送邮件时出现 asp.net NetworkInformationException - 原因是什么?
SmtpClient smtp = new SmtpClient(smtpServer);
smtp.Send(msgMail);
在第二行,有时会抛出此异常:
System.Net.NetworkInformation.NetworkInformationException:
with Message: "A non-blocking socket operation Could not be Completed Again"
这是什么意思?可能是什么原因?
一般情况下,邮件发送在大多数情况下都可以正常工作。 这是一台 IIS7 Windows 2008 Server 计算机。
谢谢。
编辑:
我在这里发现了一些东西: http://www.thevbzone.com/modWINSOCK.bas
Public Const WSAEWOULDBLOCK = (WSABASEERR + 35) ' A non-blocking socket operation could not be completed immediately
MSDN 对此错误进行了说明(< a href="http://msdn.microsoft.com/en-us/library/ms740668%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us /library/ms740668%28VS.85%29.aspx):
资源暂时不可用。
此错误是从非阻塞套接字上的操作返回的
无法立即完成,...
那么,这实际上意味着什么?我应该忽略该错误,重新发送邮件吗...?谢谢。
SmtpClient smtp = new SmtpClient(smtpServer);
smtp.Send(msgMail);
On second line sometimes this exception is thrown:
System.Net.NetworkInformation.NetworkInformationException:
with Message: "A non-blocking socket operation could not be completed immediately"
What does that mean? What can be the reason?
Mail sending in general is working most times.
It's a IIS7 Windows 2008 Server machine.
Thank you.
Edit:
I found something here:
http://www.thevbzone.com/modWINSOCK.bas
Public Const WSAEWOULDBLOCK = (WSABASEERR + 35) ' A non-blocking socket operation could not be completed immediately
MSDN says about this error (http://msdn.microsoft.com/en-us/library/ms740668%28VS.85%29.aspx):
Resource temporarily unavailable.
This error is returned from operations on nonblocking sockets that
cannot be completed immediately,...
So, what does that mean actually? Should I just ignore the error, resend the mail...? thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您应该检查 NetworkInformationException 的 ErrorCode 属性,然后在 这篇女士文章。它为您提供有关异常的更多信息。
First of all you should check ErrorCode property of NetworkInformationException and then find this error code in this ms article. It gives to you more information about exception.