Virtual Developer Workshop: Containerized Development with Docker

Wes Clyburn already wrote an SMTP class that sent mails which were stored in CMailMessage entities. Look at his entry on the Codeguru site for details.

I took these classes and added a POP3 class, based on Wes' CSMTP class. For this, I slightly modified CMailMessage and CSMTP.

Now you can create a message in a CMailMessage class, send it using Wes' CSMTP. Or you can retrieve mails using my CPOP3 class, which stores the mails in a CMailMessage object.

However, I still had some troubles parsing the headers of retrieved mails:
  1. The Cc: field can contain several lines. CPOP3 only parses the first one.
      Cc: recipient1 
    In this case, CPOP3 only finds "recipient1".

  2. The Date: field isn't parsed at all - there are different possible date formats.

Maybe I'll add those features later ? Thanks, Wes, for the good base you provided !

Download source/demo project - 19 KB


  • SMTP/POP3 using C++

    Posted by Legacy on 11/29/2003 08:00am

    Originally posted by: Vishnu

    can i get open source code for POP3/SMTP servers which works on linux platform.

  • Transmitter is always "<somebody>@post.webmailer.de"

    Posted by Legacy on 07/22/2003 07:00am

    Originally posted by: Andreas Wortmann


    thanks for these nice classes :)
    Due to the fact that I'm totally new to using sockets in
    vc++, I've got ne clue why the above mentioned happens every
    time I send an email.
    No matter which smtp server I'm using, the sender ist always
    <somebody>@post.webmailer.de (currently I'm using Web.de and Strato for testing purposes). Is there any way I can
    change this?

    Andreas Wortmann

  • any help on pop3 server

    Posted by Legacy on 03/08/2003 08:00am

    Originally posted by: sharon james

    as i'm a beginner in vc++ programming ...
    i'd be grateful if anyone can tell me what r the initial
    steps i should follow to develop a pop3 server.
    it'll be useful ..if i can get some immediate responses.
    thank you.

  • How to use "AUTH" command in SMTP

    Posted by Legacy on 03/04/2003 08:00am

    Originally posted by: Teron

    My mail server needs to authentication. How insert it into Code

    "HELO smpt.newmail.ru\r\n",
    "MAIL FROM:<Teron@NewMail.ru>\r\n",
    "RCPT TO:<Teron@NewMail.ru>\r\n",

  • Memory Leak.

    Posted by Legacy on 09/02/2002 07:00am

    Originally posted by: John Tullos

    The CPOP3 class has a memory leak that starts with Connect(), I havn't tracked it down to the exact problem, but the class is leaking memory every time it connects and checks for e-mail. Doesn't anyone bother checking for this these days? Suppose someone ran this class all day for 7 days, thats just hopeless, CRRAASSHHH. Nice job with the class, just you forgot to check for leaks :-)

    P.S. Now im stuck to finding ur leak :-(

    • Leak

      Posted by Geno Carman on 12/16/2004 04:22am

      I have been using this class for a while and never detected a leak.

  • Parsing downloaded mails using VB

    Posted by Legacy on 07/05/2002 07:00am

    Originally posted by: C.V.Kishore Kumar

    Is there any standard APIs to split the downloaded mail content(ie., attachment,mail body etc.),or is there any standards to to parse mails of any server.pls advice me.

    C.V.Kishore Kumar

  • SMTP works but POP3 doesn't

    Posted by Legacy on 01/11/2002 08:00am

    Originally posted by: Lizhongxian

    CSMTP class sounds OK. But when I use CPop3,it return me with msg "bad username", why?
    Anyone can help me?

  • i can't send mail using stmp or receive any mails using pop3!

    Posted by Legacy on 09/10/2001 07:00am

    Originally posted by: helenwh

    when sending, the error is :"503, SMTP server not ready for data"; but i can send mail to the one with the same LAN with me.
    when receiving, the error is: "RETReive failed".
    thank u for your help!!!
    best regards!

  • Help needed on : if( !get_response( IDENTIFICATION ) )

    Posted by Legacy on 07/18/2001 07:00am

    Originally posted by: Steven


    Everything seems to work just fine until I reach
    if( !get_response( IDENTIFICATION ) )
    This reacts very slowly on different servers, but is not giving any errors.
    Did anybody improve this program or used it in any way ?
    It seems to be quite difficult to find information on the subject...
    Any help is welcome.


  • I can't view mail recv message

    Posted by Legacy on 06/27/2001 07:00am

    Originally posted by: kom

    I can not view mail so recv message.

  • Loading, Please Wait ...

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date