''Operation has been canceled'' issue occurs in version 21.12 and 21.6 when sending mail through smtp

Hi,
I have used Aspose.Email.dll version 21.12 in my c# project, but I am getting the ‘Operation has been canceled’ error on sending mail through smtp. Then I tried version 21.6 encountered still the same error. Then I tried for version 21.4 and there I could hardly see the error, but my QA still reported on it.

Can you please check for the issue and also check for the updated version compatibility of the issue as it is encountered in the 21.6 and 21.12 versions of the assembly. Though it is referred to as resolved in version 21.4 per the link below:

Aspose.Email for .NET 21.4 Release Notes|Documentation

Thanks & Regards,
Yogesh

@yogesh.chhabra

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input data.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

@tahir.manzoor

The input data is just a simple mail sent through the smtp using the Aspose assembly. But the mails are sent in a loop of around 1000 to 2000 iterations.
And one more thing that has come to the notice is that the ‘‘Operation has been canceled’’ exception occurs as soon the internet connection is disrupted. And this exception occurs as first exception of loop iteration (say iteration X of 2000) and further till the internet is down the exception occurs as ‘‘Connect Failure’’ (for iteration X+1) and then on successful net connection the mail functionality resumes.
Please check for it.

Thanks,
Yogesh

@yogesh.chhabra

We have logged this problem in our issue tracking system as EMAILNET-40500. You will be notified via this forum thread once there is an update available on it.

We apologize for your inconvenience.

@tahir.manzoor

Thanks for the tracking and updates.

Regards,
Yogesh

@tahir.manzoor

There is a small query that can you please share me the main reason for the issue occurring i.e. ‘Operation has been Cancelled’.

Thanks,
Yogesh

@yogesh.chhabra

This issue is pending for analysis. Once we complete the analysis of this issue, we will then share the root cause of it.

@tahir.manzoor
Just a small concern that as mentioned in Release notes for version 21.4 of Aspose.Email assembly, it says the issue 41023 ‘Operation has been canceled’ has been fixed.
What fix has been done in it?

Thanks,
Yogesh

@yogesh.chhabra

Please try to use SmtpClient and set EmailClient.UseAuthentication to false. Hope this helps you.

@tahir.manzoor

Thanks for the updates, but setting SmtpClient.UseAuthentication to false,
Won’t it lead to less security and violate the requirements of getting authorization credentials (username and password) from users that we are presently associating with smtpClient,
or the credentials will still be required to be associated with smtpClient.

Regards,
Yogesh

@yogesh.chhabra

We have logged your concerns in our issue tracking system. We will inform you via this forum thread once there is an update available on it.

@tahir.manzoor
Just a reminder, if the reason for the ‘Operation has been canceled’ issue could be known, we shall be thankful to you.

Regards,
Yogesh

@yogesh.chhabra

We have fixed this issue and its fix will be available in the next version of Aspose.Email for .NET i.e. 22.1. In case of internet connection issues an appropriate exception will be thrown.

The operation 'MAIL' terminated. Timeout has been reached.

For the next iteration “ConnectFailure” exception will be raised if the connection is not restored.

@tahir.manzoor

Thanks for the updates related to the fix to be available in the new assembly version 22.1
By the way, what time is the new version of Aspose.Email(22.1) could be expected?
Please share

Regards,
Yogesh

@yogesh.chhabra

We are in communication with our product team about the release date of Aspose.Email for .NET 22.1. We will inform you via this forum thread once it is released.

@yogesh.chhabra

The Aspose.Email for .NET 21.1 release will be published by the end of next week.

@tahir.manzoor

Thanks for the updates. Hoping the issue resolution in the new assembly version 22.1

Regards,
Yogesh

@yogesh.chhabra

Hopefully, the next version of Aspose.Email for .NET will be available by the end of this week.

@yogesh.chhabra

Please download the latest version of Aspose.Email for .NET 22.1 for the fix of EMAILNET-40500 issue.

@tahir.manzoor

Thanks for the updates, I will use and get it verified.
Thanks once again.

Regards,
Yogesh