Before you get too excited, this solution only appears to work in Outlook and not Thunderbird. I’ll explain a workaround for Thunderbird, but let’s first get Outlook work and the gist of what this post is about.
So I had a situation where I used the Java Mail API to create a .EML file (RFC spec for email files). I had the code create the required information such as an attachment, subject, content etc. Once I had the server side code create the .eml file with the necessary fields, I would stream the text based eml file back to the browser. When you try and open the eml file without setting any header related information, I found the file did not open in compose mode, instead it was just as if I was reading the email. So to work around this, I added the header fields in my Java code to include the following:
Once I opened the eml file in Outlook, tada, it opened in Compose mode with my attachment, subject etc. I was happy, and then tried it in Thunderbird, and to my dismay, it did not open in compose mode. I read a few posts that indicated there were some Thunderbird specific params I could use in the header, but they did not work for me. I also read a ticket on the Thunderbird groups to indicate it was a problem and may be addressed some time. So the way I worked around this in Thunderbird was to open the .eml file and then right click on the note and selected, Edit as New Message. Certainly not the best solution, but it’s better than having to forward the message etc.