SmtpException 和 SmtpFailedRecipientException 之间有什么区别
What is the difference between a SmtpException and a SmtpFailedRecipientException
我一直在查看 MSDN 文档,但我似乎无法弄清楚有什么区别:
Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation.
Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation to a particular recipient.
我在文档中找不到任何关于 "operation to a particular recipient" 实际含义的信息。
一边
我问的原因是因为我试图在我的客户端应用程序中捕获某些异常并相应地执行不同的方法。
例如:
- 如果服务器出现故障,我想将文件留在原处
- 如果发送地址无效我想将文件移动到"Failed"文件夹
SmtpClient.cs 的来源表明 SmtpException 用于试图到达发送消息点的异常。 SmtpFailedRecipientException 是针对到达客户端的错误(但服务器上的一切工作正常)。
我一直在查看 MSDN 文档,但我似乎无法弄清楚有什么区别:
Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation.
Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation to a particular recipient.
我在文档中找不到任何关于 "operation to a particular recipient" 实际含义的信息。
一边
我问的原因是因为我试图在我的客户端应用程序中捕获某些异常并相应地执行不同的方法。
例如:
- 如果服务器出现故障,我想将文件留在原处
- 如果发送地址无效我想将文件移动到"Failed"文件夹
SmtpClient.cs 的来源表明 SmtpException 用于试图到达发送消息点的异常。 SmtpFailedRecipientException 是针对到达客户端的错误(但服务器上的一切工作正常)。