Exception in latest version 25.4, worked in 25.3

When upgrading to 25.4 of Aspose from 25.3, I now get the following exception when attempting to load a document that worked in version 25.3.

The code to load is pretty simple:

    MsgLoadOptions htmlLoadOptions = new MsgLoadOptions()
    {
        Timeout = (int)TimeSpan.FromSeconds(30).TotalMilliseconds,
    };

    using (MailMessage msg = MailMessage.Load(fileName, htmlLoadOptions))
   {
   }

The stack trace is

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.ExceptionServices\ExceptionDispatchInfo.cs:line 72
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zc2DLITKzSR9Mdy72vfhu_mo8IKdIjnP3tmEYsS8=(Exception #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zcT35dojx_sCZW9SJNSF5Bl7pijrp(Object #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=z6VdY58mFv4GQ6wPep3wrAhwcNR8KnBtcZw==(#=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY= #=z3Ty9vzw=, #=qV5U2i4xFADDV3yYtmgaOkZtjbA9les2KIajiRXH2DII= #=zTvRxSkk=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=z2uZXcTWOHDab3MgwokwKIcik262r()
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zXKta3Vg0I8XyBgzmaqGLOJoCmQLp(Boolean #=z3Ty9vzw=)
— End of stack trace from previous location —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.ExceptionServices\ExceptionDispatchInfo.cs:line 72
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zc2DLITKzSR9Mdy72vfhu_mo8IKdIjnP3tmEYsS8=(Exception #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zcT35dojx_sCZW9SJNSF5Bl7pijrp(Object #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zowlfK6pMb9qyGvhcXgTTIFSTi4m3()
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=z8TK8IRDE4z0g0312nqNyIr4Og_2HcMPgBw==(#=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY= #=z3Ty9vzw=, #=qV5U2i4xFADDV3yYtmgaOkZtjbA9les2KIajiRXH2DII= #=zTvRxSkk=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=z2uZXcTWOHDab3MgwokwKIcik262r()
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zXKta3Vg0I8XyBgzmaqGLOJoCmQLp(Boolean #=z3Ty9vzw=)
— End of stack trace from previous location —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.ExceptionServices\ExceptionDispatchInfo.cs:line 72
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zc2DLITKzSR9Mdy72vfhu_mo8IKdIjnP3tmEYsS8=(Exception #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zcT35dojx_sCZW9SJNSF5Bl7pijrp(Object #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zowlfK6pMb9qyGvhcXgTTIFSTi4m3()
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zPJ5DP8ZwDKvo3fO7MCDmP__hP87SbkUnPgSMVw4=(Object #=z3Ty9vzw=, UInt32 #=zTvRxSkk=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zXKta3Vg0I8XyBgzmaqGLOJoCmQLp(Boolean #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zXKta3Vg0I8XyBgzmaqGLOJoCmQLp(Boolean #=z3Ty9vzw=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zwv7YfAB03MQcwrp32g2v7P0FVoFSPCTVfCuWewp6dGBw()
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=za3B1chCbofjotZ_7sbz_IAn8uCFBlnc4ZxL_YB7MzKOz(Object[] #=z3Ty9vzw=, Type[] #=zTvRxSkk=, Type[] #=zbVle6rk=, Object[] #=zXe_Jc_U=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zhrUADIb3IGVNgjFyXwCnF2_VJdJsGB_UcyJ6Ms8=(Stream #=z3Ty9vzw=, String #=zTvRxSkk=, Object[] #=zbVle6rk=, Type[] #=zXe_Jc_U=, Type[] #=zSGMJZNc=, Object[] #=zWV29Jus=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zfQT1KZHWYwpLQ12w8p79MUI=(Stream #=z3Ty9vzw=, String #=zTvRxSkk=, Object[] #=zbVle6rk=)
at #=qaZ1xMXqCYtFeDGhG8UEKs7qtpIOlrA6JLUcrPbLW2hY=.#=zIw$NAf8vY6Ld3PJdNVh60G5VkOF0(Stream #=z3Ty9vzw=, String #=zTvRxSkk=, Object[] #=zbVle6rk=)
at Aspose.Email.Mapi.MapiMessageItemBase.#=zqz_iO18=()
at Aspose.Email.Mapi.MapiMessageItemBase…ctor()
at Aspose.Email.Mapi.MapiMessage…ctor(Boolean #=zmgF0ogacM_HibGb6zw==)
at Aspose.Email.Mapi.MapiMessage.#=zreU57tV5tyzgctyCDg==(#=znJ2__vNDntm1CTtLX7cUwlRUyLgJ #=ztfRhZRo6CSjsZMli1g==)
at Aspose.Email.Mapi.MapiMessageReader.ReadMessage()
at Aspose.Email.MailMessage.#=z$U4sN8aE4B0z(Stream #=zrfFiqhk=, MsgLoadOptions #=zhl87mf4=)
at Aspose.Email.MailMessage.#=zQyChJ5G0zYO3(Stream #=zrfFiqhk=, LoadOptions #=zhl87mf4=)
at Aspose.Email.MailMessage.Load(String fileName, LoadOptions options)

@skowald

It seems that you are encountering an exception when trying to load a document using Aspose.Email version 25.4, which was previously working in version 25.3. The code snippet you provided for loading the message looks correct, and the exception stack trace indicates that there might be an issue with the document format or the way it is being processed in the newer version.

Here are a few steps you can take to troubleshoot this issue:

  1. Check Document Format: Ensure that the document you are trying to load is indeed in the correct format (either .eml or .msg). Sometimes, files may have the correct extension but are not formatted properly.

  2. Review Release Notes: Check the release notes for version 25.4 to see if there are any breaking changes or known issues related to loading messages. This can provide insights into whether the issue is a result of changes made in the new version.

  3. Test with Different Files: Try loading different .msg or .eml files to see if the issue is specific to the file you are using. This can help determine if the problem lies with the file itself.

  4. Use LoadOptions: You are already using MsgLoadOptions, which is good. Ensure that the options you are setting are appropriate for the type of message you are loading. You might want to experiment with different settings or even try loading the file without any options to see if that resolves the issue.

  5. Contact Support: If the problem persists, consider reaching out to Aspose support with the specific file that is causing the issue. They may be able to provide more detailed assistance or identify if there is a bug in the new version.

If you have access to the documentation, you can refer to the MailMessage.Load method for more details on how to properly load messages and the parameters involved here.

If you need further assistance, feel free to ask!

Hello @skowald,

Thank you for providing the details.
Please try the Aspose.Email for .NET 25.4.1 and let us know if the issue persists.