SMTP/POP3 MFC classes

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 
    
          recipient2 
    
          recipient3 
    
          recipient4 
    
    
    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



Comments

  • SMTP/POP3 using C++

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

    Originally posted by: Vishnu

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

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

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

    Originally posted by: Andreas Wortmann

    Hi,

    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?

    Regards,
    Andreas Wortmann

    Reply
  • any help on pop3 server

    Posted by Legacy on 03/08/2003 12: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.

    Reply
  • How to use "AUTH" command in SMTP

    Posted by Legacy on 03/04/2003 12: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",
    "DATA\r\n",
    "Message!\r\n\r\n.\r\n",
    "QUIT\r\n",

    Reply
  • Memory Leak.

    Posted by Legacy on 09/02/2002 12: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 :-)
    -John

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

    • Leak

      Posted by Geno Carman on 12/15/2004 08:22pm

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

      Reply
    Reply
  • Parsing downloaded mails using VB

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

    Originally posted by: C.V.Kishore Kumar

    Hi,
    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.

    Thanks,
    C.V.Kishore Kumar

    Reply
  • SMTP works but POP3 doesn't

    Posted by Legacy on 01/11/2002 12: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?

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

    Posted by Legacy on 09/10/2001 12: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!

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

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

    Originally posted by: Steven

    Hello,

    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.

    Steven

    Reply
  • I can't view mail recv message

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

    Originally posted by: kom

    I can not view mail so recv message.
    

    Reply
  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • With 81% of employees using their phones at work, companies have stopped asking: "Is corporate data leaking from personal devices?" and started asking: "How do we effectively prevent corporate data from leaking from personal devices?" The answer has not been simple. ZixOne raises the bar on BYOD security by not allowing email data to reside on the device. In addition, Zix allows employees to maintain complete control of their personal device, therefore satisfying privacy demands of valued employees and the …

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds