Email Send Failure [closed]

强颜欢笑 提交于 2019-12-13 08:43:40

问题


If I've list of emailTo address and one of them is invalid.

Does client.Send(email); returns failure/Exception?


回答1:


Yes the SMTPClient's Send(MailMessage) method raises a SmtpFailedRecipientsException exception if one or more recipient addresses were incorrect or unreachable.




回答2:


Yes and no. For server local addresses (if you send from abc@domain.com to def@domain.com) mail server may return error immediately, but generally speaking mail server processes requests asynchronously and does not return any error if recipient address is invalid.




回答3:


This is all in the documentation of the SmtpClient class, which you should always read before asking:

When sending e-mail using Send to multiple recipients and the SMTP server accepts some recipients as valid and rejects others, Send sends e-mail to the accepted recipients and then a SmtpFailedRecipientsException is thrown. The exception will contain a listing of the recipients that were rejected.



来源:https://stackoverflow.com/questions/9256382/email-send-failure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!