COMMAIL Sample: Demonstrates an Automation Client Application with Compiler COM Support
COMMAIL is a standalone Automation client. It automates MAPI for Microsoft Exchange 4.0 (or later) or Microsoft Outlook. This sample sends an e-mail message which contains its source code to a specified e-mail recipient.
Building and Running the Sample
To build this sample with Microsoft Office XP, be sure that the macro OfficeXP is defined in your code as follows:
#define OFFICEXP 1.
To build and run this sample
- Open the solution commail.sln.
- Modify paths and file names in the source code by following the instructions given in the
//To DOlines in commail.cpp.
- Change the recipient e-mail name and other e-mail parameters. Search the source code for
#pragmafor instructions on what you need to modify.
- Add the directory path to olemsg32.dll (Office 97) or cdo.dll (Office 2000 and Office XP). You can add this file to your Include files path in the VC++ Directories dialog box.
- On the Build menu, click Build.
- On the Debug menu, click Start Without Debugging.
Look at the type library header files (.tlh and .tli). Compare the COM interfaces in the header files with interfaces of the same type library displayed by OLEVIEW.
This sample demonstrates the following keywords:
dispinterface; #import; _com_ptr_t; _variant_t; _bstr_t; _com_error