Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Second question: Storing emails in which format ?

Second question: Storing emails in which format ?

Scheduled Pinned Locked Moved The Lounge
questioncsharphtmlcsssales
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan R Hansen
    wrote on last edited by
    #1

    OK, second question of the day :-D We might have to create an application to archive different types of files, including emails as the customer wants a central archive of various "communication elements". Most files are easy to handle, but emails are giving us headaches right now. In Outlook you can save an email as html - which will give you e.g. test.html that (for HTML mails) has tags like <cid:blahblah >. This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible. As the reference is "internal" it wont help to store the image next to the html file. The same is more or less valid for "external" attachments. You can also choose to save the mail in .msg format which enables you to open it later (in outlook) with all internal and external attachments intact. However - I cannot find any C# code that will allow you to extract text and attachments from this message format, although it seem to be in RFC-822 format. Thunderbird saves such files as .eml, and this should be the same format, but it doesn't seem to be. Now to the questions: * Are you familiar with programatically "browsing" in .msg files ? How is that done ? * Is the Microsoft .msg format a plain RFC-standard ? * Do you have any other suggestions regarding how we save emails for later use ? Any other comments are of course most welcome. /Jan Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    G P N 3 Replies Last reply
    0
    • J Jan R Hansen

      OK, second question of the day :-D We might have to create an application to archive different types of files, including emails as the customer wants a central archive of various "communication elements". Most files are easy to handle, but emails are giving us headaches right now. In Outlook you can save an email as html - which will give you e.g. test.html that (for HTML mails) has tags like <cid:blahblah >. This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible. As the reference is "internal" it wont help to store the image next to the html file. The same is more or less valid for "external" attachments. You can also choose to save the mail in .msg format which enables you to open it later (in outlook) with all internal and external attachments intact. However - I cannot find any C# code that will allow you to extract text and attachments from this message format, although it seem to be in RFC-822 format. Thunderbird saves such files as .eml, and this should be the same format, but it doesn't seem to be. Now to the questions: * Are you familiar with programatically "browsing" in .msg files ? How is that done ? * Is the Microsoft .msg format a plain RFC-standard ? * Do you have any other suggestions regarding how we save emails for later use ? Any other comments are of course most welcome. /Jan Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

      G Offline
      G Offline
      Graham Bradshaw
      wrote on last edited by
      #2

      This is getting dangerously close to a programming answer, but here goes anyway...

      Jan R Hansen wrote:

      test.html that (for HTML mails) has tags like . This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible.

      They can be - we do something similar for one of our projects that stores HTML formatted reports with graphics. We cheated slightly, and saved a standard IE web page as a "web archive", and reverse engineered that file format. Basically, the tag references a data section (MIME section from memory) that contains a text encoding of the base-64 encoding of the image data.

      J 1 Reply Last reply
      0
      • J Jan R Hansen

        OK, second question of the day :-D We might have to create an application to archive different types of files, including emails as the customer wants a central archive of various "communication elements". Most files are easy to handle, but emails are giving us headaches right now. In Outlook you can save an email as html - which will give you e.g. test.html that (for HTML mails) has tags like <cid:blahblah >. This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible. As the reference is "internal" it wont help to store the image next to the html file. The same is more or less valid for "external" attachments. You can also choose to save the mail in .msg format which enables you to open it later (in outlook) with all internal and external attachments intact. However - I cannot find any C# code that will allow you to extract text and attachments from this message format, although it seem to be in RFC-822 format. Thunderbird saves such files as .eml, and this should be the same format, but it doesn't seem to be. Now to the questions: * Are you familiar with programatically "browsing" in .msg files ? How is that done ? * Is the Microsoft .msg format a plain RFC-standard ? * Do you have any other suggestions regarding how we save emails for later use ? Any other comments are of course most welcome. /Jan Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        Outlook express stores them in the "raw transfer format" (RFC WTF), unfortunately, few e-mail clients are that clever. (Neither Outlook, nor Netscrape)


        We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
        boost your code || Fold With Us! || sighist

        V B 2 Replies Last reply
        0
        • G Graham Bradshaw

          This is getting dangerously close to a programming answer, but here goes anyway...

          Jan R Hansen wrote:

          test.html that (for HTML mails) has tags like . This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible.

          They can be - we do something similar for one of our projects that stores HTML formatted reports with graphics. We cheated slightly, and saved a standard IE web page as a "web archive", and reverse engineered that file format. Basically, the tag references a data section (MIME section from memory) that contains a text encoding of the base-64 encoding of the image data.

          J Offline
          J Offline
          Jan R Hansen
          wrote on last edited by
          #4

          hehe... nobody said it wasn't allowed to give programming *answers*, only to ask programming questions :o) Well, I know that the html could be hacked to contain the image, but the problem is that we want a) a simple way to save emails from outlook b) some way of reading the content of the emails without having to open outlook every time. What I've discovered so far is that Outlook 2003 saves the complete thing in a .msg file, and ThunderBird in a .eml file. It's somewhat difficult to find out which format the files conform to, but they *should* be RFC-822 compliant. However, I'm a bit suspicious that Microsoft may have their own format, because the files don't look exactly as the .eml files. And I'm just puzzled that I can't find a zillion examples on how to access .msg files here on CP. Furthermore, all the open source people usually want to implements standards (sometimes it seem to be just for the sake of doing it, but that a discussion that should be in the soapbox), and that just tells me that the .msg files aren't the same as .eml files. So there might be something rotten, somewhere :) I can smell it... Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

          1 Reply Last reply
          0
          • P peterchen

            Outlook express stores them in the "raw transfer format" (RFC WTF), unfortunately, few e-mail clients are that clever. (Neither Outlook, nor Netscrape)


            We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
            boost your code || Fold With Us! || sighist

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            peterchen wrote:

            Netscrape

            Somehow, I don't think it was a typo on your part... :laugh: Cheers, Vikram.


            "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.

            P 1 Reply Last reply
            0
            • P peterchen

              Outlook express stores them in the "raw transfer format" (RFC WTF), unfortunately, few e-mail clients are that clever. (Neither Outlook, nor Netscrape)


              We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
              boost your code || Fold With Us! || sighist

              B Offline
              B Offline
              Bassam Abdul Baki
              wrote on last edited by
              #6

              We need an Office/VBA forum. "If only one person knows the truth, it is still the truth." - Mahatma Gandhi Web - Blog - RSS - Math

              1 Reply Last reply
              0
              • V Vikram A Punathambekar

                peterchen wrote:

                Netscrape

                Somehow, I don't think it was a typo on your part... :laugh: Cheers, Vikram.


                "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.

                P Offline
                P Offline
                peterchen
                wrote on last edited by
                #7

                :cool: Did you know that, when accessing netscrape through MAPI, it opens the Netscrape internet browser too?!


                We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
                boost your code || Fold With Us! || sighist

                1 Reply Last reply
                0
                • J Jan R Hansen

                  OK, second question of the day :-D We might have to create an application to archive different types of files, including emails as the customer wants a central archive of various "communication elements". Most files are easy to handle, but emails are giving us headaches right now. In Outlook you can save an email as html - which will give you e.g. test.html that (for HTML mails) has tags like <cid:blahblah >. This refers to the inline-stored images of the original mail, but these aren't stored in the saved test.html file and are therefore not visible. As the reference is "internal" it wont help to store the image next to the html file. The same is more or less valid for "external" attachments. You can also choose to save the mail in .msg format which enables you to open it later (in outlook) with all internal and external attachments intact. However - I cannot find any C# code that will allow you to extract text and attachments from this message format, although it seem to be in RFC-822 format. Thunderbird saves such files as .eml, and this should be the same format, but it doesn't seem to be. Now to the questions: * Are you familiar with programatically "browsing" in .msg files ? How is that done ? * Is the Microsoft .msg format a plain RFC-standard ? * Do you have any other suggestions regarding how we save emails for later use ? Any other comments are of course most welcome. /Jan Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                  N Offline
                  N Offline
                  NotYourAverageGuy
                  wrote on last edited by
                  #8

                  An Outlook .msg file is a structured storage file that contains the MAPI properties of the message and it's subobjects. The exact format of the names and content of the IStream and IStorage objects is not 'officially' documented but with a bit of probing you should be able to figure it out. You would need to use MAPI and the structured storage interfaces to copy the contents back and forth between the message store and the .msg file. -George

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups