{"id":5524,"date":"2022-02-06T21:54:55","date_gmt":"2022-02-06T21:54:55","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=5524"},"modified":"2022-02-16T00:38:34","modified_gmt":"2022-02-16T00:38:34","slug":"asp-net-c-project-to-send-e-mail-via-office-365-starts-firing-net_io_connectionclosed","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/asp-net-c-project-to-send-e-mail-via-office-365-starts-firing-net_io_connectionclosed","title":{"rendered":"ASP.NET C# project to send e-mail via Office 365  starts firing net_io_connectionclosed"},"content":{"rendered":"<p style=\"padding-left: 40px;\">System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String&amp; response) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException&amp; exception) at System.Net.Mail.SmtpClient.Send(MailMessage message)<\/p><p><strong>Need to change ASP to use TLS 1.2 as Microsoft of EOL TLS1.1 and rejecting emails occasionally to remind you of this!\u00a0<\/strong><\/p><p>Upgrading the .net Framework to 4.6 and over will fix this<\/p><p>This the web.config file for this :\u00a0\u00a0<\/p><p>&lt;system.web&gt;<br \/>&lt;compilation targetFramework=&#8221;4.6&#8243;\/&gt; &lt;!&#8211; Changed framework from Under 4.5 to 4.6 or 4.7 &#8211;&gt;<br \/>&lt;!&#8211;Added this httpRuntime &#8211;&gt;<br \/>&lt;httpRuntime targetFramework=&#8221;4.6&#8243; \/&gt;<br \/>&lt;\/system.web&gt;<\/p><p class=\"lang-cs s-code-block\"><code class=\"hljs language-csharp\"><\/code><\/p>","protected":false},"excerpt":{"rendered":"<p>System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3500,3713,598,3568,571,3714,3715,2350],"class_list":["post-5524","post","type-post","status-publish","format-standard","hentry","category-research","tag-1-1","tag-1-2","tag-asp","tag-net_io_connectionclosed","tag-office-365","tag-system-io-ioexception","tag-system-net-mail-smtpreplyreaderfactory","tag-tls"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=5524"}],"version-history":[{"count":3,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5524\/revisions"}],"predecessor-version":[{"id":5566,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5524\/revisions\/5566"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=5524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=5524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=5524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}