ID: Q171096
The information in this article applies to:
This is a Simple MAPI console application that demonstrates how to use most of the Simple MAPI functions available. It is written in Microsoft Visual C++ 5.0 but any previous version of the compiler works just as well.
The following file is available for download from the Microsoft Software Library:
~ Smplmapi.exe (size: 57431 bytes)
For more information about downloading files from the Microsoft Software
Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591
TITLE : How to Obtain Microsoft Support Files from Online Services
This self-extracting executable file contains the following files:
SwapMain.cpp SwapMain.h Swap.cpp Swap.h Swap.exe
SwapMain.cpp is the main controlling program file. It is responsible for displaying a menu to the user and interpreting the commands given by the user. The code in this file is written specifically for a console application, but because it makes calls into a separate module that implements functionality using a user-defined class, a windows style application could be easily substituted as the main controller of the application.
Swap.cpp is the implementation of an application class that provides the basic functionality required by the menu presented in the main control module.
This messaging application is a Simple MAPI client. It implements the following features:
The user is prompted for a profile name. If it can find the profile name in the list of profiles, it will log the user on to the messaging system. If it cannot find the profile entered by the user in the list of profiles, the user is to cancel the operation or choose from an existing list.
The user is prompted with an address book list. When an entry is chosen from this list, the method allocates a buffer and stuffs the buffer with the e-mail address of the recipient chosen in the list. The buffer must be released by the caller of this method.
The user is prompted to type an e-mail address. When a valid e-mail name is entered and found in the address book, the method allocates storage for a buffer and stuffs the buffer with the display name of the e-mail alias. The buffer allocated in this method must be released by the caller.
The user is prompted to type an e-mail address. When a valid e-mail address is entered and found in the address book, the user is presented a "details" page filled with information specific to the e-mail address entered by the user.
The user is prompted with the default "Compose Note" form. When the message has been given a recipient to send to and the send button is pressed, the intended recipient gets the message.
The user is prompted for the intended recipient. After a valid recipient is entered, a hard-coded message is sent to the intended recipient.
The user is prompted for the intended recipient. After a valid recipient is entered, the user is prompted for the file and path of a file to attach. The file name must be the 8.3 representation of the file to attach. The path name must be in the following format: "c:\windows\" (Note: the trailing backspace is mandatory). A message is then sent to the intended recipient.
A new message is automatically created in the Inbox of the user's default message store.
The user is presented with a list of the messages in the user's default message store Inbox.
The user is presented with the contents of the next unread message in the default message store Inbox.
The session handle is released and the user is logged off of the messaging system. No MAPI specific menu options are available until the user requests to be logged back on to the messaging system. The application remains running until the user chooses to exit the application. If the user elects to exit the application without first logging off, the session is terminated in an orderly fashion and then the application closes.
Keywords : kbfile kbsample kbMAPI kbMsg kbMAPI000 SMapiCMC
Version : WINDOWS:1.0
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 16, 1999