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. reading POP3 mails using c++

reading POP3 mails using c++

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadmintoolshelptutorial
19 Posts 3 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.
  • R Ravi Bhavnani

    No need to use MAPI. See this article for a simple way to access your POP server. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

    O Offline
    O Offline
    omkamal
    wrote on last edited by
    #6

    Thank you Ravi for the reply. But there is something I need to tell. I tried directly from my cmd box and telnet to my pop3 server. I tried to pull the mails. It worked fine, but it gives me only garbage for the attachments. It also throws an info saying, "Since the mail message is in MIME format your mail reader is unable to translate it and so part or all of the message you may see are not text" - or something like it. Is there any other way to read and save my attachments (especially with the exact file name that the sender sent)? Remember, I want this utility to work in a lights-out environment. All the end user should see the next morning is bunch files on a specified folder. He should not care what command line program executes underneath. omkamal

    R 1 Reply Last reply
    0
    • R Ravi Bhavnani

      Also see the articles here. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

      O Offline
      O Offline
      omkamal
      wrote on last edited by
      #7

      Thanks for all the links. You give a whole bunch of work for the rest of the day. But please dont go anywhere. I may get back to you for any problems. Thanks so much again. omkamal

      1 Reply Last reply
      0
      • R Ravi Bhavnani

        Also see the articles here. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

        O Offline
        O Offline
        omkamal
        wrote on last edited by
        #8

        See I told I will get back to you. I checked this link (codeguru link that you sent me finally). Looked like it had a whole lot of samples and classes to explore. But just go thru the comments of different people. Everyone ask the author about how to read an attachment. Funny thing is either the author does not reply to them or one even said the following Hi, please do not contact me regarding the handling of attachments. I have no idea, and I never extended these classes to handle attachments. Sorry, but this is something you have to find out yourself. Thanks, Michael Submitted By: Michael Krebs (2001/06/13) Go up a level Isnt this weird that no one knows how to read a MIME type multipart attachment from a POP3 mail server? :eek: [Now, ravi do you understand how X| I am.] Oh please help me again... omkamal

        R 2 Replies Last reply
        0
        • O omkamal

          Hi, We have a pop3 email server and several accounts. There is one specific account which receives some important .csv files from clients as attachments. I am writing a program which reads these mails and extract the attachment. For heavens sake, can someone tell me how to do this in c++. You dont have to provide a code, but atleast direct me where I should start. I used Simple MAPI, but it only reads mails from the profiles created in your machine (or the machine where u install the program). And my program should not expect any profile created already for that email account. My program should be a command line utility for reading mails that you provide, server name, user name, pwd and other necessary info and hit enter - it should copy all the mail attachments to any folder that either u specify or it is configured somewhere. [After a week long reading, I am so fed up of reading MAPI materials but nothing gets into my mind - feeling like fish out of water] Please help me... omkamal

          N Offline
          N Offline
          Neville Franks
          wrote on last edited by
          #9

          Have a look at Chilkat Mail - http://www.chilkatsoft.com/ChilkatMail.asp It should do what you want. Neville Franks, Author of ED for Windows. www.getsoft.com

          O 1 Reply Last reply
          0
          • O omkamal

            See I told I will get back to you. I checked this link (codeguru link that you sent me finally). Looked like it had a whole lot of samples and classes to explore. But just go thru the comments of different people. Everyone ask the author about how to read an attachment. Funny thing is either the author does not reply to them or one even said the following Hi, please do not contact me regarding the handling of attachments. I have no idea, and I never extended these classes to handle attachments. Sorry, but this is something you have to find out yourself. Thanks, Michael Submitted By: Michael Krebs (2001/06/13) Go up a level Isnt this weird that no one knows how to read a MIME type multipart attachment from a POP3 mail server? :eek: [Now, ravi do you understand how X| I am.] Oh please help me again... omkamal

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #10

            Darn, I know I've seen source code for extracting attachments from a raw mail message... I will keep looking. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

            O 1 Reply Last reply
            0
            • O omkamal

              See I told I will get back to you. I checked this link (codeguru link that you sent me finally). Looked like it had a whole lot of samples and classes to explore. But just go thru the comments of different people. Everyone ask the author about how to read an attachment. Funny thing is either the author does not reply to them or one even said the following Hi, please do not contact me regarding the handling of attachments. I have no idea, and I never extended these classes to handle attachments. Sorry, but this is something you have to find out yourself. Thanks, Michael Submitted By: Michael Krebs (2001/06/13) Go up a level Isnt this weird that no one knows how to read a MIME type multipart attachment from a POP3 mail server? :eek: [Now, ravi do you understand how X| I am.] Oh please help me again... omkamal

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #11

              See this CP article on Mime utils. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

              1 Reply Last reply
              0
              • R Ravi Bhavnani

                Darn, I know I've seen source code for extracting attachments from a raw mail message... I will keep looking. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                O Offline
                O Offline
                omkamal
                wrote on last edited by
                #12

                I think I found one from the codeguru link itself. I have gone thru the source code. Boy! its very heavy duty. The guy actually wrote whatever text that comes outta pop3 server Retr command to a file first. He then parses thru the file, literally checking for strings like "To:", "From:", "Content-Disposition: attachment - <>" and then extracts everything to different variables. Thats too much work though. Why in the world are there no C++ APIs or classes to do all these? May be I should start writing them if no one really did before. The sample that I am talking about in the codeguru link is this... POP3 Client With Attachment - Alexander Volkov (2002/02/15) Here is a simple COM server that is able to receive a mail messages and extract attached files. omkamal

                R 1 Reply Last reply
                0
                • N Neville Franks

                  Have a look at Chilkat Mail - http://www.chilkatsoft.com/ChilkatMail.asp It should do what you want. Neville Franks, Author of ED for Windows. www.getsoft.com

                  O Offline
                  O Offline
                  omkamal
                  wrote on last edited by
                  #13

                  Thanks Neville, I am looking thru the code. But before I go any further have you used it. Is there a simple client written consuming this COM, that i can use? [Just to save my time] omkamal

                  N 1 Reply Last reply
                  0
                  • O omkamal

                    I think I found one from the codeguru link itself. I have gone thru the source code. Boy! its very heavy duty. The guy actually wrote whatever text that comes outta pop3 server Retr command to a file first. He then parses thru the file, literally checking for strings like "To:", "From:", "Content-Disposition: attachment - <>" and then extracts everything to different variables. Thats too much work though. Why in the world are there no C++ APIs or classes to do all these? May be I should start writing them if no one really did before. The sample that I am talking about in the codeguru link is this... POP3 Client With Attachment - Alexander Volkov (2002/02/15) Here is a simple COM server that is able to receive a mail messages and extract attached files. omkamal

                    R Offline
                    R Offline
                    Ravi Bhavnani
                    wrote on last edited by
                    #14

                    There are commercial libs available to do this. omkamal wrote: May be I should start writing them if no one really did before. That would be great! Please consider posting your article at CP. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                    O 1 Reply Last reply
                    0
                    • R Ravi Bhavnani

                      There are commercial libs available to do this. omkamal wrote: May be I should start writing them if no one really did before. That would be great! Please consider posting your article at CP. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                      O Offline
                      O Offline
                      omkamal
                      wrote on last edited by
                      #15

                      I never thought my Friday would be driven this nuts. I better go out for some movie or my head would be charbroiled. Almost burning.........:mad: omkamal

                      R 1 Reply Last reply
                      0
                      • O omkamal

                        I never thought my Friday would be driven this nuts. I better go out for some movie or my head would be charbroiled. Almost burning.........:mad: omkamal

                        R Offline
                        R Offline
                        Ravi Bhavnani
                        wrote on last edited by
                        #16

                        What!? You'd pass up a night of hacking the COmkamalEmailAttachment class for mindless entertainment? :) /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                        O 1 Reply Last reply
                        0
                        • R Ravi Bhavnani

                          What!? You'd pass up a night of hacking the COmkamalEmailAttachment class for mindless entertainment? :) /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                          O Offline
                          O Offline
                          omkamal
                          wrote on last edited by
                          #17

                          You never know ravi, how many .dsw and .dsp I have written so far starting from MAPI and until POP3 and MIME protocols with Winsock and a whole lot of fun. I even have a feeling to quit my job. My boss is my only cheerleader now. (and ofcourse CP). omkamal

                          1 Reply Last reply
                          0
                          • O omkamal

                            Thanks Neville, I am looking thru the code. But before I go any further have you used it. Is there a simple client written consuming this COM, that i can use? [Just to save my time] omkamal

                            N Offline
                            N Offline
                            Neville Franks
                            wrote on last edited by
                            #18

                            omkamal wrote: Is there a simple client written consuming this COM, that i can use? [Just to save my time] Have a look at the sample code which Matt includes. I haven't actually used it apart from a quick play with the samples. The mailing list is active and Matt is quick to respond to problems. Quite amazing seeing that it is free. Neville Franks, Author of ED for Windows. www.getsoft.com

                            O 1 Reply Last reply
                            0
                            • N Neville Franks

                              omkamal wrote: Is there a simple client written consuming this COM, that i can use? [Just to save my time] Have a look at the sample code which Matt includes. I haven't actually used it apart from a quick play with the samples. The mailing list is active and Matt is quick to respond to problems. Quite amazing seeing that it is free. Neville Franks, Author of ED for Windows. www.getsoft.com

                              O Offline
                              O Offline
                              omkamal
                              wrote on last edited by
                              #19

                              Neville, Thanks for letting me know about this software. Neville Franks wrote: The mailing list is active and Matt is quick to respond to problems. I am very impressed, as he replied me back within a moment for my questions. Neville Franks wrote: Quite amazing seeing that it is free This is exactly true. omkamal

                              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