We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving certain messages with MailMessage.Save runs very slowly

A customer is getting some emails that are causing service timeouts because MailMessage.Save has really long run times (over 3 minutes). Testing a variety of similar / typical emails from the customer ranging in size from less than 200KB to over 5000KB and 1 to 14 PDF attachments, they all seem to be able to run under 1 second. Occasionally an email comes through that’s less than 2000K but takes 3 to 4 minutes for the Save call to complete.

If I forward the message it saves in 2 or 3 seconds which is still longer than most other messages at sub second times but fast enough to not cause any problems. I did notice the Content-Type changed from…
Content-Type: application/ms-tnef; name=“winmail.dat”
Content-Transfer-Encoding: binary
…to…
Content-Type: multipart/mixed;
…on the forwarded email. Other customer messages are a mix of these.

In researching I came across this post:
API hangs on converting MSG to MHTML (C# .NET)
…which seems similar. I used the code from this post to test my issue and I can reproduce the behavior. I tested this against Aspose.Email versions 20.6, 20.7 and 20.8 and the same problem exists in all.

I have a test solution to demonstrate the problem which is similar to the code from the post mentioned above but it requires specific messages to reproduce the behavior. I can supply these to Aspose upon request.

Is this a bug? What’s special about this message that causes this behavior?

Thanks for any help,
Karl

@Karlspose

Can you please provide the working sample project along with source files that you feel are performing slow while saving. Please also share the Operating System and memory profiling details on your end too.We will be able to proceed further with investigation on our end on provision of requested information.

@Karlspose

I have created an issue with ID EMAILNET-39932 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.