The underlying connection was closed: An unexpected error occurred on a send

The Exchange service EEAttachments can save your attachments or mails automatically to your file-system and process it by your own scripts.
Post Reply
Greenman
Posts: 10
Joined: Tue Aug 18, 2020 12:54 pm

The underlying connection was closed: An unexpected error occurred on a send

Post by Greenman » Mon Jun 27, 2022 10:09 am

Since two weeks we are getting the following error in the log files, about 4 to 8 times per day. I also tried running EEAttachments at my local desktop, here I'm seeing the same issues. I'm facing the same problem for @outlook.com addresses as well as our O365 accounts. All import are going correct but I've a lot of false errors in the log files. Any suggestions?

Import:Exc3:ForChanges: Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The underlying connection was closed: An unexpected error occurred on a send. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
--- End of inner exception stack trace ---
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.SyncFolderItems(FolderId syncFolderId, PropertySet propertySet, IEnumerable`1 ignoredItemIds, Int32 maxChangesReturned, SyncFolderItemsScope syncScope, String syncState)
at EEAttachments.ExportJob.<>c__DisplayClass244_0.AXKIzbwfrY()
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at EEAttachments.ExportJob.euwTc18gj6(ExchangeService )

User avatar
Sven
Site Admin
Posts: 1450
Joined: Sun Jan 06, 2008 9:54 pm
Contact:

Re: The underlying connection was closed: An unexpected error occurred on a send

Post by Sven » Tue Jun 28, 2022 12:12 pm

Do you use the newest version? (Help => Update)

Greenman
Posts: 10
Joined: Tue Aug 18, 2020 12:54 pm

Re: The underlying connection was closed: An unexpected error occurred on a send

Post by Greenman » Fri Jul 01, 2022 5:57 am

Hello Sven,
I'm currently using version 1.25.44, as far as I know this is the newest version.
Thanks, Arnoud

User avatar
Sven
Site Admin
Posts: 1450
Joined: Sun Jan 06, 2008 9:54 pm
Contact:

Re: The underlying connection was closed: An unexpected error occurred on a send

Post by Sven » Fri Jul 01, 2022 1:27 pm

How do you connect to O365. There is a version selector in the connection, this should be on O365, not Exchange 2016.
MS has stopped the basic auth for O365, so you have to use OAuth instead: https://docs.microsoft.com/en-us/exchan ... nge-online

Greenman
Posts: 10
Joined: Tue Aug 18, 2020 12:54 pm

Re: The underlying connection was closed: An unexpected error occurred on a send

Post by Greenman » Fri Jul 08, 2022 10:47 am

At the moment we are using the O365 OAuth server version. OAuth is already used to connect to O365.

Post Reply