SMTP/POP3 MFC classes | CodeGuru

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 4, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.