Office365 outgoing SMTP intermittently failing to send mail with net_io_connectionclosed error

Version 1


    We are using Office365 to send our outgoing messages (notifications, approval voting cards, etc.) and we have recently been having "Email NOT sent" failures with the error message  "System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed."

    Example of full error:
    Email NOT sent with the following error(s): SMTP host: 'pod<number>'; SSL: 'True' - SaaS.WebUI.Action.SendEmailActionDefException: SendAsyncEmail [TenantId=<tenant>, UserId=]. ---> System.Net.Mail.SmtpException: Failure sending mail. ---> 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& response)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       --- End of inner exception stack trace ---
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at SaaS.WebUI.Action.SendEmailActionDef.SendAsyncEmail(Object p)
       --- End of inner exception stack trace ---.




    What I believe solved the problem was a change to the SMTP server address.

    Our original SMTP server address was pod<number> and still works most of the time. I checked for the current O365 SMTP server address in our portal and it should be

    I changed my config to point to this new address and the problem seems to have gone away.