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

Free Support Forum - aspose.com

Save Document as HTML and Email example

I am using the code supplied in the ‘Save Document as HTML and Email’ example in the Aspose Examples Dashboard in an ASP.NET webapplication. This works for the most part, but there is one line of code that causes a problem:

’ This frees the Message.html file if an exception occurs.
End Try

message.dispose() causes all my session variables to be deleted, which breaks the functionality of my webapplication.

Without calling message.dispose() I cannot delete the temporary files that are created to embed the images.

Do you have any idea why session variables are being deleted when calling message.dispose, or do you know of another way to accomplish this without calling message.dispose?

Hi Niels,

Your query is related to MailMessage class. You can post your query in .NET forums for a detailed reply. However, you can use Using block instead of calling Dispose method. Hopefully this will resolve the issue.

Best Regards,

I have tried to use a Using block to send the email, but this didn’t help. I would really appreciate some more support, since the supplied example is useless in it’s current state.

I turns out that it is not message.dispose(), but the fact that the folder that is being deleted is in (a subfolder) of the webapplication root. Changing the filestructure causes the app to recycle and delete the sessions.

Hi Niels,

Good to know that you have figured it out and thanks for sharing the details with us.

Best Regards,