| |||||
|
|
Hi all, Today we will try to cover some portion or at least get a start in one of the largest topics in MSDN. This is called Messaging API's or MAPI. MAPI is a huge collection of services/API's that provide messaging functionality. There are simply too many things involved in this and I will leave you at the mercy of MSDN to go through some of these which interest you. The part that we will cover today is called SMAPI or Simple MAPI. This is a simplified sub set of MAPI which enables an application to send/receive mails etc. There are around 12 functions available for C/C++ in this set. We will see the steps involved in sending a mail using SMAPI.So the first step is to begin a MAPI session. You do this using MAPILogon() api. See MSDN for help on this and other SMAPI functions. Next step is to get the recipients to whom you want to send a mail. Now typically, you will have a profile name for the recipient such as "Farooque Khan" or "All". We need to get this resolved to MapiRecipDesc structure which the MAPI subsystem understands. This can be done using MAPIResolveName() api. This API will take the profile name to resolve and give us the required structure. Now is the time to send the mail. This is done using MAPISendMail() API. Apart from other things, this API takes a MapiMessage structure which contains information about the mail/message. One of the parameters for this is the MapiRecipDesc structure which we just got resolved. Other parameters of this structure are things such as subject, message text and optionally attachment files etc. Once the mail is sent, you should cleanup the session by calling MAPILogoff() api.So in these few steps you are able to potentially use the whole MAPI subsystem which is very complex in itself. Hence these API's are called Simple MAPI. But to get more control over the messaging subsystem the SMAPI falls short and we have to look into core MAPI. Hence it's very important to understand the MAPI subsystem, it's architecture and it's accessories.Exercises: 1. Study SMAPI and write a simple application using it, which can send mails to multiple recipients with one or more attachments.2. Study MAPI, Address book providers, transport providers, message store providers etc. 3. Study other accessories of MAPI such as CMC etc. MAPI is a very big topic and this session does not cover even 1 percent of it. I have tried to give you a head start in MAPI so that you are able to use it in your own projects. We will try to cover one more such topic (TAPI) next week.Thanks for your time. -Farooque
|