CPJNSMTPConnection 3.06

An MFC class to encapsulate the SMTP protocol
The CPJNSMTPConnection was designed to provide a collection of MFC classes to support the SMTP protocol. SMTP for those not familiar with all the internet protocols is the protocol used to send internet email.

Also included with the SMTP classes in the download is a class called "CPJNMD5Hash" which provides for calculation of MD5 hashes and HMACs using the MS Crypto API as well as a class called "CNTLMClientAuth" which provides a reusable client side implementation for NTLM authentication.

Important!: Please note that I have been informed that CPJNSMTPConnection is being used to develop and send unsolicited bulk mail. This was not the intention of the code and the author explicitly forbids use of the code for any software of this kind.

Main features:

  • Simple and clean C++ interface.
  • The interface provided is synchronous which provides an easier programming model than using asynchronous sockets.
  • The code does not rely on the MFC socket classes. These classes have a number of shortcomings, one of which causes problems when they are used in NT services.
  • The code can be used in a console application without any problems (Again this is not the case for the MFC socket classes).
  • A configurable timeout for the connection can be set through the class API.
  • The classes are fully Unicode compliant and include Unicode built options in the workspace file.
  • As of v1.1, the classes now fully supports file attachments.
  • Full support is included for CC (Carbon Copy) & BCC (Blind Carbon Copy).
  • Support for regular email address formats and multiple email address parsing.
  • Full support for MIME and MHTML (aka HTML Email).
  • Full support for MIME Charsets.
  • Comprehensive sample program included which exercises most of the classes functionality.
  • As of v2.61, the classes now fully support sending email over SSL. This means that for instance you can use the Gmail SMTP server "smtp.gmail.com" on port 465. Also note that all of the other features such as authentication are fully supported over SSL. For example to use Gmail you will require some form of authentication such as AUTH PLAIN because it does not operate as an open relay (which would facilitate spam).
  • Supports numerous authentication protocols including "AUTH CRAM-MD5", "AUTH LOGIN", "AUTH PLAIN" and "AUTH NTLM". An "Auto Detection" form of authentication is also supported. In this mode, the authentication protocols supported by the server are detected and the most appropriate protocol is used.
  • As of v2.65, the classes include comprehensive support for DSN's (Delivery Status Notifications) as specified in RFC 3461.

last updated on:
April 16th, 2014, 1:32 GMT
file size:
1 MB
developed by:
Naughter Software
license type:
operating system(s):
Windows All
C: \ Programming \ Components & Libraries


In a hurry? Add it to your Download Basket!

user rating



2 Screenshots
CPJNSMTPConnection - The main window of demo application that uses CPJNSMTPConnection component.CPJNSMTPConnection - The settings window of CPJNSMTPConnection will enable you to add the mail server details.
What's New in This Release:
  • The sample app is now linked against the latest OpenSSL v1.0.1g dlls. This version is the patched version of OpenSSL which does not suffer from the Heartbleed bug.
  • Please note that by default OpenSSL does not do host name validation. The sample app provided with the PJNSMTP code also does not do host name validation. This means that as it stands the sample app is vulnerable to man in the middle attacks if you use SSL/TLS to connect to a SMTP server.
read full changelog

Add your review!