Trying to convert HTML files to EML

6,786

Solution 1

I'm sure there must be other methods to export mail from Thunderbird. But if you really have only html files, you could use this script as a workaround. You will lose sender, recipient and subject, but the body will still be readable.

@echo off

for %%f in (*.html) do (
    echo Content-Type: text/html > %%~nf.eml
    echo. >> %%~nf.eml
    type %%f >> %%~nf.eml
)

Save the script with a .bat file extension, and place it in a directory containing the html files. Double click on it to generate an eml file for each html.

Solution 2

You can't html files contain message text only. Not enough info to create EML files. You need additional headers like Subject, From, To, etc. I know there are a couple of EML export plugins for Thunderbird.

Share:
6,786

Related videos on Youtube

Anna
Author by

Anna

Updated on September 18, 2022

Comments

  • Anna
    Anna over 1 year

    I am trying to import some messages from my old mail client to thunderbird v24.3 (so that they will sync into gmail). I have all the messages saved as .html files as this is the only option I was given on export from that mail client. I have tried to find a converter that will convert these files to eml so that I can view them in thunderbird but I am yet to find such a tool on the web. Does anyone know how I can convert html to eml (or msg or pst, and then I can use PST Viewer) so that I can then gain access to these emails in thunderbird or outlook, or even directly into gmail? I have both windows and mac so willing to try any options on those. Thanks, Anna

    • Mawg says reinstate Monica
      Mawg says reinstate Monica over 5 years
      Thjs probably ought to be migrated to softwarerecs.stackexchange.com where the OP can ask for an app to do this