Send Timeout Even Though Message Sent

If I set timeout out fairly low say 10 seconds and add a large attachment say 4MB. It will sometimes generate a timeout exception. However the email will still arrive at it’s destination.

Hi Martin,


Thank you for posting your query.

I have tried this at my end with the latest version of Aspose.Email for .NET 5.5.0 but was not able to reproduce the same behavior at my end. There is no exception raised and the emails are always sent out. Can you please share your Smtp server information? We may try the same at our end for possible reproduction of the issue at our end.

Office 365,



smtp.office365.com,



Port 587

Hi Martin,


We have repeated our tests with office 365 test account by sending 10+ emails consecutively and none of these raise any exception. All the emails were sent out successfully. Can you please share with us if this issue happens very frequently at your end? If possible, please share a test account on the server with us so that we can use it to reproduce the issue at our end and forward to our product team.

This was fairly easy to reproduce if using a large attachment and low timeout but still long enough for it to send. Setting timeout very high won’t reproduce it. I could perhaps reproduce it 30% of the time.

I have no server details to share as this was done on Office 365 so you can just use own account.

Hi Martin,


I have tested the scenario again by using my own Office 365 account. An attachment of 4 MB is attached with the message, 10 seconds timeout is set and mails are sent 20 times. It is observed that always the WebException is raised with message “The operation has timed out” and no mail is sent during the testing.

Could you please let us know the average time of sending such a mail in your environment? It will help us to analyze the issue and provide assistance accordingly.


I suggest you keep setting the timeout lower by 1 second increments until the time taken to send the email is as close as possible to the timeout. I don’t know the average time of sending an email. I sent a 4MB attachment with a 10 second timeout. So it sounds like your environment is quicker so I would reduce the timeout. If the 10 seconds is plenty then it won’t replicate the problem.

Hi Martin,


I have tried the scenario by setting the Timout value slightly less (about 800 ms) than the actual mail sending time. It is observed that exception is raised and mail is also sent many times. This issue is logged in our bug reporting system under Id:EMAILNET-34953 for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.

Hi, any news on EMAILNET-34953?

Hi Martin,

EWS client uses exchange web service. On the client side we use ExchangeServiceBinding class which is derived from System.Web.Services.Protocols.WebClientProtocol. When we set timeout value, this value is assigned to a WebClientProtocol.Timeout property. 'Send' method implements atomic request to the server by the ExchangeServiceBinding.CreateItem. So the problem with border value of timeout, is a problem of implementation in web service. Unfortunately Microsoft does not provide support of transactions for operations in exchange web service. So we can't fix this issue. As workaround of this problem you may set little more value of timeout.

We are sorry for any inconvenience caused in this regard.