⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch4.htm

📁 MAPI__SAPI__TAPI
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<html>

<head>
<title>Chapter 4 -- MAPI Architecture</title>
<meta NAME="GENERATOR" CONTENT="Microsoft FrontPage 3.0">
</head>

<body TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#CE2910">
<!-- Spidersoft WebZIP Ad Banner Insert -->
<!-- End of Spidersoft WebZIP Ad Banner Insert-->

<h1><font COLOR="#FF0000">Chapter 4</font></h1>

<h1><b><font SIZE="5" COLOR="#FF0000">MAPI Architecture</font></b> </h1>

<hr WIDTH="100%">

<h3 ALIGN="CENTER"><font SIZE="+2" COLOR="#000000">CONTENTS<a NAME="CONTENTS"></a> </font></h3>

<ul>
  <li><a HREF="#TheMAPIClient">The MAPI Client</a> <ul>
      <li><a HREF="#MessagesandAttachments">Messages and Attachments</a> </li>
      <li><a HREF="#StorageFolders">Storage Folders</a> </li>
      <li><a HREF="#Addresses">Addresses</a> </li>
    </ul>
  </li>
  <li><a HREF="#TheMAPIServer">The MAPI Server</a> <ul>
      <li><a HREF="#MessageTransport">Message Transport</a> </li>
      <li><a HREF="#MessageStores">Message Stores</a> </li>
      <li><a HREF="#AddressBooks">Address Books</a> </li>
    </ul>
  </li>
  <li><a HREF="#TheMAPISpooler">The MAPI Spooler</a> </li>
  <li><a HREF="#Summary">Summary</a> </li>
</ul>

<hr>

<p>In <a HREF="ch3.htm">Chapter 3</a>, &quot;What Is MAPI?,&quot; you learned the general 
outline of the messaging API and how MAPI fits into Microsoft's Windows Open Systems 
Architecture (WOSA) scheme. You also learned about the three most common types of MAPI 
messages (ASCII text, formatted documents or binary files, and control messages). Lastly, <a
HREF="ch3.htm">Chapter 3</a> described the three major categories of MAPI applications 
(e-mail, message-aware, and message-enabled). </p>

<p>In this chapter, you'll learn about the basic conceptual components of MAPI-the MAPI <br>
Client and the MAPI Server. These two components work together to create, transport, and 
store messages within the MAPI system. </p>

<p>MAPI clients deal with three main objects: 

<ul>
  <li><font COLOR="#000000">Messages and attachments</font> </li>
  <li><font COLOR="#000000">Storage folders</font> </li>
  <li><font COLOR="#000000">Addresses</font> </li>
</ul>

<p>Each of these objects is represented slightly differently in the various versions of 
MAPI implementations you'll learn about in this book. For example, the MAPI OCX tools that 
ship with Visual Basic allow only limited access to folders and address information. The 
Messaging OLE layer (provided through the MAPI 1.0 SDK) provides increased access to 
folders and addresses, but only the full MAPI 1.0 functions allow programmers to add, 
edit, and delete folders and addresses at the client level. This chapter will cover all 
three objects in a general sense. Later chapters will provide detailed programming 
examples. </p>

<p>MAPI servers also deal with three main objects: 

<ul>
  <li><font COLOR="#000000">Message transport</font> </li>
  <li><font COLOR="#000000">Message stores</font> </li>
  <li><font COLOR="#000000">Addresses books</font> </li>
</ul>

<p>As you can see, the server side of MAPI is quite similar to the client side (see Figure 
4.1). </p>

<p><a HREF="f4-1.gif"><b>Figure 4.1 : </b><i>Client and server aspects of the MAPI system.</i></a> 
</p>

<p>Where the client is concerned with creating and manipulating messages, the server 
component is concerned with the transporting of those same messages. Where the client side 
is accessing storage folders, the server side is dealing with message storage, and both 
client and server must deal with message addresses. However, the MAPI server has the 
responsibility of managing the transport, storage, and addressing of messages from any 
number of client applications. </p>

<p>In addition to maintaining the message base for all local clients, MAPI servers also 
have the task of moving messages to and from remote servers and clients. The final section 
of this chapter talks briefly about a special MAPI component that handles this task-the 
MAPI Spooler. </p>

<p>When you complete this chapter, you'll understand the fundamental tasks that must be 
performed by all MAPI clients and MAPI servers and the basic objects maintained and 
manipulated by both client and server applications. Once you have a grasp of the general 
operations of a MAPI system, you'll be ready to explore MAPI functions from a Windows 
programming perspective in the coming chapters. </p>

<h2><a NAME="TheMAPIClient"><font SIZE="5" COLOR="#FF0000">The MAPI Client</font></a></h2>

<p>The MAPI Client is the application that runs on the user's workstation. This is the 
application that requests services from the MAPI Server. As mentioned in the preceding 
chapter, client applications can be generic e-mail tools such as Microsoft's Microsoft 
Mail or Exchange Mail Client for Windows 95. Client applications can also be message-aware 
applications like the Microsoft Office Suite of applications. Each of these applications 
provides access to the message server via a send menu option or command button. Lastly, 
message-enabled applications, ones that use MAPI services as a primary part of their 
functionality, can be built to meet a specific need. These programs usually hide the MAPI 
services behind data entry screens that request message-related information and then 
format and send messages using the available message server. </p>

<p>All MAPI clients must, at some level, deal with three basic objects: 

<ul>
  <li><font COLOR="#000000">Messages and attachments</font> </li>
  <li><font COLOR="#000000">Storage folders</font> </li>
  <li><font COLOR="#000000">Addresses</font> </li>
</ul>

<p>Depending on the type of client application, one or more of these MAPI objects may be 
hidden from the client interface. However, even though they may not be visible to the 
application user, all three objects are present as part of the MAPI architecture. The next 
three sections describe each of the MAPI client objects and their functions in the MAPI 
model. </p>

<h3><a NAME="MessagesandAttachments">Messages and Attachments</a> </h3>

<p>The MAPI system exists in order to move messages from one location to another. 
Therefore, the heart of the system is the MAPI message object. All message objects must 
have two components-a message header and a message body. The message header contains 
information used by MAPI to route and track the movement of the message object. The 
message body contains the actual text message portion of the message object. Even though 
every message object must have a message body, the body can be left blank. In addition to 
the two required components, message objects can also have one or more attachments. 
Attachments can be any valid operating system file such as an ASCII text file, a binary 
image, or an executable program. </p>

<h4>The Message Header</h4>

<p>The Message Header contains all the information needed to deliver the associated 
message body and attachments. Data stored in the message header varies, depending on the 
messaging service provider. While the exact items and their names and values differ 
between messaging systems (CMC, MAPI, OLE Messaging), there is a basic core set that 
appears in all message headers. Examples of basic data items that can be found in a 
message header are listed in Table 4.1. </p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><b>Note</b></td>
  </tr>
  <tr>
    <td><blockquote>
      <p>The item names given in Table 4.1 do not necessarily correspond to a valid property or 
      variable name in programming code. The actual property names for each item can vary from 
      one code set to another. Also, the order in which these properties appear differs greatly 
      for each MAPI implementation. The chapters following this one focus on different code sets 
      (CMC API, MAPI Controls, OLE Messaging) and detail the exact keywords and property names 
      used to access the items described here.</p>
    </blockquote>
    </td>
  </tr>
</table>
</center></div>

<p align="center"><b>Table 4.1. Basic data items found in a message header.</b> </p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><p align="center"><i><font SIZE="2">Property Name</font></i> </td>
    <td WIDTH="180"><p align="center"><i><font SIZE="2">Type</font></i> </td>
    <td WIDTH="273"><p align="center"><i><font SIZE="2">Description</font></i> </td>
  </tr>
  <tr>
    <td WIDTH="138"><tt><font FACE="Courier">Recipients</font></tt> </td>
    <td WIDTH="180">Recipients object</td>
    <td WIDTH="273">E-mail address of the person who will receive the message. This could be a 
    single name, a list of names, or a group name. </td>
  </tr>
  <tr>
    <td WIDTH="138"><tt><font FACE="Courier">Sender</font></tt> </td>
    <td WIDTH="180">AddressEntry object</td>
    <td WIDTH="273">E-mail address of the person who sent the message. </td>
  </tr>
  <tr>
    <td WIDTH="138"><tt><font FACE="Courier">Subject</font></tt> </td>
    <td WIDTH="180">String</td>
    <td WIDTH="273">A short text line describing the message. </td>
  </tr>
  <tr>
    <td WIDTH="138"><tt><font FACE="Courier">TimeReceived</font></tt> </td>
    <td WIDTH="180">Variant (Date/Time)</td>
    <td WIDTH="273">The date and time the message was received. </td>
  </tr>
  <tr>
    <td WIDTH="138"><tt><font FACE="Courier">TimeSent</font></tt> </td>
    <td WIDTH="180">Variant (Date/Time)</td>
    <td WIDTH="273">The date and time the message was sent. </td>
  </tr>
</table>
</center></div>

<p>Along with this basic set, additional data items may appear or be available to the 
programmer. These additional items add functionality to the MAPI interface, but because 
they are not part of the core set, you cannot expect them to be available to you when you 
write your programs. Table 4.2 contains a list of additional header data items.<br>
</p>

<p align="center"><b>Table 4.2. Optional items that may be found in the message header.</b> 
</p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><i>Property Name</i></td>
    <td WIDTH="75"><i>Type</i> </td>
    <td WIDTH="349"><i>Description</i></td>
  </tr>
  <tr>
    <td WIDTH="166"><tt><font FACE="Courier">DeliveryReceipt</font></tt> </td>
    <td WIDTH="75">Boolean</td>
    <td WIDTH="349">Flag that indicates the sender asked for a return receipt message upon 
    either delivery of the message to the recipient or the reading of the message by the 
    recipient. </td>
  </tr>
  <tr>
    <td WIDTH="166"><tt><font FACE="Courier">Importance</font></tt> </td>
    <td WIDTH="75">Long</td>
    <td WIDTH="349">A value that indicates the relative importance of the message. Currently, 
    Microsoft Mail clients recognize three priorities: High, Medium, and Low. </td>
  </tr>
  <tr>
    <td WIDTH="166"><tt><font FACE="Courier">Submitted</font></tt> </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -