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. General Programming
  3. C / C++ / MFC
  4. Extracting attachments from email

Extracting attachments from email

Scheduled Pinned Locked Moved C / C++ / MFC
csharpsysadminalgorithmshelptutorial
5 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    AlexMarbus
    wrote on last edited by
    #1

    Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.

    RaviBeeR R 2 Replies Last reply
    0
    • A AlexMarbus

      Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      See PJN's CPop3Connection[^] class and MIME++ (and other offerings) from HunnySoft[^]. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

      A 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        See PJN's CPop3Connection[^] class and MIME++ (and other offerings) from HunnySoft[^]. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

        A Offline
        A Offline
        AlexMarbus
        wrote on last edited by
        #3

        It looks very promising, but I really can't afford the 600 bucks :( -- Alex Marbus www.marbus.net But then again, I could be wrong.

        1 Reply Last reply
        0
        • A AlexMarbus

          Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.

          R Offline
          R Offline
          Rohit Sinha
          wrote on last edited by
          #4

          I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. MAPI, while OK for client side stuff, won't scale well in a server environment. You won't have to take care of too many suported encoding types, just understand MIME. Go to http://www.imc.org/rfcs.html#mime[^] for more information on MIME. Don't let the number of RFCs there scare you away, it's not for the faint of heart anyway ( ;) ). Although I'm sure you could find a lot of open source stuff out there to help you get started. AlexMarbus wrote: The case: I receive an email from the server, as 'raw data'. Wait a minute now. Are you saying the mail server will mail you the emails that it gets so that you can then extract the attachments and do your stuff with it? This can be horribly slow, and can bog the server down. Imagine what it'd be like, the same email travelling on the network twice. Or did I get it wrong and you meant something else? In any case, my suggestion would be to install your dll as a proxy for the server. It can then process the emails before they get to the email server itself, and will have done its processing (stripping the attachments, scanning for virii, whatever). Let the filter and the server communicate via the computer memory, don't use files or the network for it. You can't imagine how slow it will make everything if it's a busy site.
            Regards,

          Rohit Sinha

          A 1 Reply Last reply
          0
          • R Rohit Sinha

            I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. MAPI, while OK for client side stuff, won't scale well in a server environment. You won't have to take care of too many suported encoding types, just understand MIME. Go to http://www.imc.org/rfcs.html#mime[^] for more information on MIME. Don't let the number of RFCs there scare you away, it's not for the faint of heart anyway ( ;) ). Although I'm sure you could find a lot of open source stuff out there to help you get started. AlexMarbus wrote: The case: I receive an email from the server, as 'raw data'. Wait a minute now. Are you saying the mail server will mail you the emails that it gets so that you can then extract the attachments and do your stuff with it? This can be horribly slow, and can bog the server down. Imagine what it'd be like, the same email travelling on the network twice. Or did I get it wrong and you meant something else? In any case, my suggestion would be to install your dll as a proxy for the server. It can then process the emails before they get to the email server itself, and will have done its processing (stripping the attachments, scanning for virii, whatever). Let the filter and the server communicate via the computer memory, don't use files or the network for it. You can't imagine how slow it will make everything if it's a busy site.
              Regards,

            Rohit Sinha

            A Offline
            A Offline
            AlexMarbus
            wrote on last edited by
            #5

            Rohit Sinha wrote: I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. I did: http://www.funduc.com/decenc.htm It does exactly what I need :-) Rohit Sinha wrote: In any case, my suggestion would be to install your dll as a proxy for the server. That is exactly what it is: a filter application for a certain mailserver (ArgoSoft). See http://triplef.marbus.net for more details. Thanks for your reply -- Alex Marbus www.marbus.net But then again, I could be wrong.

            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