FILE: Simple MAPI Console ApplicationLast reviewed: October 10, 1997Article ID: Q171096 |
The information in this article applies to:
SUMMARYThis 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 MORE INFORMATIONThis 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:
Logon to Messaging SystemThe 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.
Select a Recipient/Get E-Mail AddressThe 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.
Enter E-Mail Address/Get RecipientThe 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.
Get Details of RecipientThe 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.
Send Mail Message to Recipient Using Default UIThe 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.
Send Mail Message to Recipient with No User InterfaceThe user is prompted for the intended recipient. After a valid recipient is entered, a hard-coded message is sent to the intended recipient.
Send Mail Message with an AttachmentThe 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.
Create a New MessageA new message is automatically created in the Inbox of the user's default message store.
List Messages in the InboxThe user is presented with a list of the messages in the user's default message store Inbox.
Read Next Unread MessageThe user is presented with the contents of the next unread message in the default message store Inbox.
Log Off of the Messaging SystemThe 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 : kbsample SMapiCMC Version : WINDOWS:1.0 Platform : WINDOWS Issue type : kbhowto Solution Type : kbfile |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |