How to check MailMessage was delivered in .NET?

后端 未结 4 1627
旧时难觅i
旧时难觅i 2020-12-11 11:45

Is there a way to check if SmtpClient successfully delivered an email? SmtpClient.Send() does not appear to return anything other than an exception. So if the method complet

4条回答
  •  春和景丽
    2020-12-11 12:37

    One solution you could use is to create an httphandler for your website images. If you send an HTML message which includes at least 1 image, then you could embed querystring data to the end of that image. This could even be something like a 1x1 transparent image. When the user reads the email, this sends the request to the server to fetch the image data, and in turn, you could capture that request and denote that the message was read.

    This is not bulletproof however, because most email clients block images by default unless the user specifies they would like to view images in the email.

提交回复
热议问题