{"id":1061,"date":"2010-09-25T17:14:39","date_gmt":"2010-09-25T15:14:39","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1061"},"modified":"2019-05-20T18:20:45","modified_gmt":"2019-05-20T16:20:45","slug":"requesting-read-receipt","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/requesting-read-receipt","title":{"rendered":"Requesting read receipt (MDN)"},"content":{"rendered":"<div class=\"well\">\nYou can also read how to: <\/p>\n<ul>\n<li>Request a read receipt<\/li>\n<li><a href=\"\/blog\/creating-read-receipt-mdn\">Create a read receipt<\/a><\/li>\n<li><a href=\"\/blog\/processing-read-receipt-mdn\">Process a read receipt<\/a><\/li>\n<\/ul>\n<\/div>\n<p>Message headers are commonly used to store various e-mail metadata such as spam filtering score, mail agent name or other flags.<\/p>\n<p>Several headers can be used to <strong>request a delivery receipt<\/strong> for the message. This will make the recipient&#8217;s mail client (such as Outlook) notify the sender if the user have read the message.<\/p>\n<p>Please note that the <strong>reply is not mandatory<\/strong> &#8211; not all e-mail clients support it and those who do usually ask the user for a permission before sending the receipt. Even though, it is still a useful feature.<\/p>\n<p>As usual different mail clients honor different headers: &#8216;Disposition-Notification-To&#8217;, &#8216;Return-Receipt-To&#8217; and &#8216;X-Confirm-Reading-To&#8217;.<\/p>\n<p><a href=\"\/mail\">Mail.dll .NET email client<\/a> provides you a single method for that: <strong>RequestReadReceipt()<\/strong> that copies all addresses from &#8220;From&#8221; collection or &#8220;Reply-To&#8221; collection to all those headers.<\/p>\n<p><strong>Read receipt requests may not always be honored<\/strong>. There are several reasons for that:<\/p>\n<ul>\n<li>A mail client may not recognize the special Disposition-Notification-To header.<\/li>\n<li>A mail client may not implement that functionality.<\/li>\n<li>The end user may have that functionality turned off.<\/li>\n<li>The end user may optionally not choose to send one for your particular email.<\/li>\n<\/ul>\n<p>The following code sends email, that requests read receipt:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version:\r\n\r\nMailBuilder builder = new MailBuilder();\r\nbuilder.From.Add(new MailBox(&quot;from@example.com&quot;, &quot;Alice&quot;));\r\nbuilder.To.Add(new MailBox(&quot;to@example.com&quot;, &quot;Bob&quot;));\r\nbuilder.Subject = &quot;Please let me know if you like it&quot;;\r\nbuilder.Html = &quot;&lt;html&gt;....&lt;\/html&gt;&quot;;\r\n\r\nbuilder.RequestReadReceipt();\r\n\r\nIMail email = builder.Create();\r\n\r\n\r\nusing(Smtp smtp = new Smtp())\r\n{\r\n    smtp.Connect(&quot;smtp.server.com&quot;);  \/\/ or ConnectSSL for SSL\r\n    smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;);\r\n \r\n    smtp.SendMessage(email);                     \r\n \r\n    smtp.Close();   \r\n}  \r\n\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version:\r\n\r\nDim builder As New MailBuilder()\r\nbuilder.From.Add(New MailBox(&quot;from@example.com&quot;, &quot;Alice&quot;))\r\nbuilder.&#x5B;To].Add(New MailBox(&quot;to@example.com&quot;, &quot;Bob&quot;))\r\nbuilder.Subject = &quot;Please let me know if you like it&quot;\r\nbuilder.Html= &quot;&lt;html&gt;....&lt;\/html&gt;&quot;\r\n\r\nbuilder.RequestReadReceipt()\r\n\r\nUsing smtp As New Smtp()\r\n    smtp.Connect(&quot;smtp.server.com&quot;)\t' or ConnectSSL for SSL\r\n    smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;)\r\n\r\n    smtp.SendMessage(email)\r\n\r\n    smtp.Close()\r\nEnd Using\r\n<\/pre>\n<p>Fluent interface equivalents:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version:\r\n\r\nusing Fluent = Limilabs.Mail.Fluent;\r\n\r\nIMail email = Fluent.Mail.Html(&quot;&lt;html&gt;....&lt;\/html&gt;&quot;)\r\n    .Subject(&quot;Please let me know if you like it&quot;)\r\n    .From(&quot;from@example.com&quot;)\r\n    .To(&quot;to@example.com&quot;)\r\n    .RequestReadReceipt()\r\n    .Create();\r\n\r\nusing(Smtp smtp = new Smtp())\r\n{\r\n    smtp.Connect(&quot;smtp.server.com&quot;);  \/\/ or ConnectSSL for SSL\r\n    smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;);\r\n \r\n    smtp.SendMessage(email);                     \r\n \r\n    smtp.Close();   \r\n}  \r\n<\/pre>\n<p>and as usual VB.NET code:<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version:\r\n\r\nImports Fluent = Limilabs.Mail.Fluent;\r\n\r\nDim email As IMail = Fluent.Mail.Html(&quot;&lt;html&gt;....&lt;\/html&gt;&quot;) _\r\n    .Subject(&quot;Please let me know if you like it&quot;) _\r\n    .From(&quot;from@example.com&quot;) _\r\n    .&#x5B;To](&quot;to@example.com&quot;) _\r\n    .RequestReadReceipt() _\r\n    .Create()\r\n\r\nUsing smtp As New Smtp()\r\n    smtp.Connect(&quot;smtp.server.com&quot;)\t' or ConnectSSL for SSL\r\n    smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;)\r\n\r\n    smtp.SendMessage(email)\r\n\r\n    smtp.Close()\r\nEnd Using\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can also read how to: Request a read receipt Create a read receipt Process a read receipt Message headers are commonly used to store various e-mail metadata such as spam filtering score, mail agent name or other flags. Several headers can be used to request a delivery receipt for the message. This will make [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15,33,95,50,57],"class_list":["post-1061","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-mdn","tag-smtp","tag-vb-net"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1061"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=1061"}],"version-history":[{"count":10,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1061\/revisions"}],"predecessor-version":[{"id":5508,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1061\/revisions\/5508"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}