CCMC v1.04 A set of MFC classes to encapsulate
sending mail using CMC (Obsolete)
Welcome to CCMC, 2 simple classes to encapsulate sending mail using the
Common Messaging Calls (CMC) interface.
CMC is a platform independent API which provides messaging capabilities similar
to simple MAPI on Windows. Other obvious API's of use to the MFC programmer are
SMTP and Simple MAPI. The author has provided classes for these at
smtp.html and cmapi.html respectively.
This class has been exclusively tested with the MS reference implementation of CMC
but should work ok with any other CMC implementation on 32 bit Windows.
Features
- Simple and clean C++ interface.
- All the code is UNICODE compliant and build configurations are provided
for this. Even though CMC only exports an ASCII versions of it's functions,
the class internally performs the necessary conversions. Please note that since
the API is ASCII based, you will still have problems if you use UNICODE characters
which cannot be represented in the ASCII code page.
- The code can be used in a console application or without bringing up any
CMC dialogs if so desired.
- The code gracefully handles the case where CMC is not installed on client
machines. Internally the class loads the DLL and uses GetProcAddress calls.
The enclosed zip file contains the source code
and a simple test program to exercise all of the functions the classes provide.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Updates
31 March 2008
- Please note that this code is now obsolete because Microsoft has dropped
support for CMC as far back as June 2000 with a security update for Outlook.
For more information please see
http://support.microsoft.com/kb/262701.
You should update your code to use this other mail delivery mechanisms such
as Simple MAPI, Extended MAPI, SMTP or CDO.
V1.04 (1 January 2007)
- Updated copyright details.
- Fixed incorrect usage of preprocessor macro in CCMCMessage::AddMultipleRecipients
method
V1.03 (22 December 2006)
- Updated copyright details
- Made function pointer typedefs part of the CCMCSession class
- Updated the code to clean compile on VC 2005.
- CCMCMessage::AddMultipleRecipients method now has a return value of void
- Optimized CCMCSession constructor code
- Addition of a CCMCMessage::AddMultipleAttachements method
- Code now uses newer C++ style casts instead of C style casts.
- Reviewed all TRACE statements for correctness
- Fixed problems when the code is compiled for UNICODE. The issue was that
the Send method was using the various T2A macros which allocates a stack based
string. This was causing issues because the recipients and attachments array
for the CMC message was being allocated in loops which was using scoping. This
scoping was causing the stack based strings to be deallocated before the "cmc_send"
method was called. This issue has now been fixed by the introduction of new
generic heap based macros in PJNConv.h which allocates the converted string
using the C++ new operator. To ensure orderly cleanup of this heap memory, the
CMC_message structure is now allocated using a hidden C++ class "CCMC_messageCleanup"
which cleans up this memory automatically in its destructor.
- General review of the code to bring it up to date with the author's simple
MAPI class.
- Addition of a CCMC_EXT_CLASS preprocessor macro to allow the classes to
be more easily added to an extension dll
V1.02 (2 April 2000)
- Password field in the configuration dialog now uses ES_PASSWORD edit control
style.
- Password value used for CMC logon is now stored in the registry encrypted
instead of as plain text.
V1.01 (28 March 2000)
- Provision of a sample app which implements a mini mail sender.
- Added a CCMCMessage::AddMultipleRecipients method similar to my SMTP class.
V1.0 (25 November 1999)