sending inline MHTML

Ali picture Ali · May 27, 2009 · Viewed 7.3k times · Source

I was wondering if it is possible through the .NET 2.0 MailMessage object to send an inline MHTML file that is created on the fly.

By inline I mean: It should be sent in a way that the user can see it, once he opens the email, without having to open/download the attachment.

Answer

dave wanta picture dave wanta · May 28, 2009

(jdecuyper -- thanks for the plug, as I wrote aspNetEmail).

You can do this with aspNetEmail. You can replace the entire contents of the email message with your MHT.

You can't do this with System.Net.Mail, but if you want to go the commerical route, pop me an email at [email protected] and I'll show you how this can be done.

If you want to go an open source route, there is probably some SMTP code on codeproject that you could modify to do this. Basically, you would inject your contents into the DATA command of the SMTP process.

One thing to note: If your MHT document has embedded scripts, flash, activeX objects or anything that may be blocked by the mail client, it probably won't render the same as what you are seeing in the browser.