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. ATL / WTL / STL
  4. Uisng ATL7 CMimeMessage classes

Uisng ATL7 CMimeMessage classes

Scheduled Pinned Locked Moved ATL / WTL / STL
comdockertoolsquestion
8 Posts 2 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.
  • A Offline
    A Offline
    Amit Dey
    wrote on last edited by
    #1

    Has anyone here used CMimeMessage to compose or decode a MIME encoded message and attachments etc?

    Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
    PocketPC New menu Office addin

    G 1 Reply Last reply
    0
    • A Amit Dey

      Has anyone here used CMimeMessage to compose or decode a MIME encoded message and attachments etc?

      Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
      PocketPC New menu Office addin

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      Yep, I did. But just some small tests, if and how it works. No real app.

      A 1 Reply Last reply
      0
      • G geo_m

        Yep, I did. But just some small tests, if and how it works. No real app.

        A Offline
        A Offline
        Amit Dey
        wrote on last edited by
        #3

        I want to use CMimeMessage and other ATL7 classes to create and decode MIME messages and attachments.For example, I want to create a MIME message with a single attachment like: IMultiLanguage *pLang = NULL; CoInitialize(NULL); CMimeMessage msg(pLang); if(msg.SetSender("visualcdev@hotmail.com")) if(msg.SetDisplayName("My custom mime message to be displayed in a string")) { msg.SetPriority(ATL_MIME_LOW_PRIORITY ); msg.SetSubject("custom subject"); msg.AddText(_T("hello world from a test message you should also end a string like this.")); msg.AddRecipient(_T("amitdey@softhome.net"),"amitdey@softhome.net",0); msg.AttachFile("C:\\scantastic.bmp"); } But when I view the contents of the message, by writing it to a file, the message is not a MIME formatted message( I cannot see the headers or anything. DWORD dwWritten; DWORD Ret = WriteFile(hFile,&msg,sizeof(msg),&dwWritten,NULL); message does not have proper MIME headers.How can I use CMimeMessage to create/modify MIME messages? Thanks.

        Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
        PocketPC New menu Office addin

        G 1 Reply Last reply
        0
        • A Amit Dey

          I want to use CMimeMessage and other ATL7 classes to create and decode MIME messages and attachments.For example, I want to create a MIME message with a single attachment like: IMultiLanguage *pLang = NULL; CoInitialize(NULL); CMimeMessage msg(pLang); if(msg.SetSender("visualcdev@hotmail.com")) if(msg.SetDisplayName("My custom mime message to be displayed in a string")) { msg.SetPriority(ATL_MIME_LOW_PRIORITY ); msg.SetSubject("custom subject"); msg.AddText(_T("hello world from a test message you should also end a string like this.")); msg.AddRecipient(_T("amitdey@softhome.net"),"amitdey@softhome.net",0); msg.AttachFile("C:\\scantastic.bmp"); } But when I view the contents of the message, by writing it to a file, the message is not a MIME formatted message( I cannot see the headers or anything. DWORD dwWritten; DWORD Ret = WriteFile(hFile,&msg,sizeof(msg),&dwWritten,NULL); message does not have proper MIME headers.How can I use CMimeMessage to create/modify MIME messages? Thanks.

          Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
          PocketPC New menu Office addin

          G Offline
          G Offline
          geo_m
          wrote on last edited by
          #4

          Hi, the first part is OK and works. Your problem is in the WriteFile phase. You cannot use the WriteFile as you did, because then you will just save the CMimeMessage class as is in memory. And because CMimeMessage nearly stores only pointers to other classes (body, attachements etc.) you'll see nothing usefull. The correct way how can you save the message is: msg.WriteData( hFile, &overlapped ); This method makes more processing, stores also the aggregated classes etc and makes a mime message for you. Hope this helps

          A 1 Reply Last reply
          0
          • G geo_m

            Hi, the first part is OK and works. Your problem is in the WriteFile phase. You cannot use the WriteFile as you did, because then you will just save the CMimeMessage class as is in memory. And because CMimeMessage nearly stores only pointers to other classes (body, attachements etc.) you'll see nothing usefull. The correct way how can you save the message is: msg.WriteData( hFile, &overlapped ); This method makes more processing, stores also the aggregated classes etc and makes a mime message for you. Hope this helps

            A Offline
            A Offline
            Amit Dey
            wrote on last edited by
            #5

            Yes, the Overlapped i/o did it. Thanks. From the samples I have seen, CMimeMessage is more for composing and sending messages, what about translating/decoding messages and attachments.

            Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
            PocketPC New menu Office addin

            A 1 Reply Last reply
            0
            • A Amit Dey

              Yes, the Overlapped i/o did it. Thanks. From the samples I have seen, CMimeMessage is more for composing and sending messages, what about translating/decoding messages and attachments.

              Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
              PocketPC New menu Office addin

              A Offline
              A Offline
              Amit Dey
              wrote on last edited by
              #6

              Also, if I have a mime-formatted message as an IStream, can I attach it anyway to a CMimeMessage and then use the classes to parse info? How? TIA.:)

              Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
              PocketPC New menu Office addin

              G 1 Reply Last reply
              0
              • A Amit Dey

                Also, if I have a mime-formatted message as an IStream, can I attach it anyway to a CMimeMessage and then use the classes to parse info? How? TIA.:)

                Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
                PocketPC New menu Office addin

                G Offline
                G Offline
                geo_m
                wrote on last edited by
                #7

                I don't think that the CMimeMessage is ready for parsing. It was designed for creating the message & sending. For parsing it will be required to use another class or build your own.

                A 1 Reply Last reply
                0
                • G geo_m

                  I don't think that the CMimeMessage is ready for parsing. It was designed for creating the message & sending. For parsing it will be required to use another class or build your own.

                  A Offline
                  A Offline
                  Amit Dey
                  wrote on last edited by
                  #8

                  Interesting. I can see that the ATL7 CMimeMessage creates correct Outlook Express mail files. i.e. .eml format. Yes, I guess I would have to write a class myself. But it should not be too difficult, esp with all decoding code in the ATL classes that I can use.:-D

                  Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
                  PocketPC New menu Office addin

                  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