下面这个网址有你要的东西,有很多示例代码,我测试过,可以下载<br><br>http://www.imibo.com/imidev/delphi/les/cdoless.html<br><br><br><br>CDO 1.2.1 in DELPHI<br>(MS Exchange Server 5.5 Edition / Microsoft Exchange Server 2000/2003 compatibles / DELPHI 5 Edition / DELPHI 6 / DELPHI 7 compatibles)<br><br>The DELPHI sources of CDO 1.2.1 in DELPHI examples are delivered via electronic Internet download after registration<br><br><br>--------------------------------------------------------------------------------<br><br>Description: Application as Lesson Source <br>PART I<br>Logging On and working with GAL <br>Example # 1 <br>Log in MS Exchange Server and<br>Query User Identity <br><br>How to:<br><br>Use CDO.Session Object <br>Use Session.Logon <br>Use Session.CurrentUser <br>Use AddressEntry <br>Find type of AddressEntry <br>Work with Fields collection <br>Work with Field property <br>Use Field.ID propery <br>Get Field.Value by MAPI TAG <br>Use Session.LogOff <br>... <br> Example1<br>(221 KB)<br> In package <br>Example # 2 <br>Retrieve MS Exchange GAL<br>(Global Address List) <br><br>global address list<br>(GAL) A MAPI address book container that holds recipient entries for an entire organization and is available to all e-mail users in that organization.<br><br>Include some steps<br>from Example #1 and<br>How to:<br><br>Get Global Address List <br>Use AddressEntries <br>Use GetFirst <br>Use GetNext <br>Link AddressEntry.DisplayType with image <br>Get Recipient Display Name <br>Get Recipient SMTP e-mail address <br>... <br> Example2<br>(241 KB) <br> In package<br> <br>Example # 3 <br>Retrieve MS Exchange "Light" Hierarchy<br>(by Global Address List)<br><br>Hierarchy Viewer<br>A hierarchy viewer is a user interface component that is used for displaying folder and address book container hierarchy tables. Hierarchy viewers can display members of the hierarchy at different levels, expanding and contracting each level on demand.<br><br>How to:<br><br>Get Global Address List <br>Use AddressEntries <br>Build "Light" Tree <br>... <br> Example3<br>(226 KB) <br> In package<br> <br>Example # 4 <br>Writing a small Hierarchy Viewer <br><br>Now we will write small GAL Hierarchy Viewer. What must do it:<br> - must show GAL<br> - must show Hierarchy<br> - must show Organization<br> - must show Sites<br> - must show Containers in each Site<br> - must show recipients in each container<br> <br> Example4<br>(250 KB)<br> In package<br> <br>PART II<br>Working with Private Information Store (Mailbox) <br>Example # 5 <br>Log in MS Exchange Server and<br>Getting Exchange Private Store Tree <br><br>In this example we will write small Exchange Private Store (mailbox) Hierarchy Viewer. <br>How to:<br><br>Open Mailbox <br>Find Exchange Private Store <br>Open Exchange Private Store <br>InfoStores collection <br>Use InfoStore Object <br>Find 'RootFolder' <br>Enumerate IPM Subtree <br>Folders Collection <br>etc.. <br> Example5<br>(227 KB)<br> In package<br> <br>Example # 6 <br>Getting Exchange Mailbox and enumerate items (messages) in each folder <br><br>How to:<br><br>Get Container Class<br>ex. IPM.Note, IPM.Contact, IPM.Task... <br>Enumerate messages in MAPI Folder <br>Get Message Subject <br>How to get Message properties <br>Work with Fields Collection <br>Work with fields <br>etc.. <br> Example6<br>(251 KB)<br> In package<br> <br>Example # 7 <br>How to build SIMPLE Mailbox reader (agent) with CDO and DELPHI <br><br> <br><br>The sample (MAIL Reader) demonstrates how-to:<br><br>Login to Exchange Server <br>Get own e-mail address <br>Get available Information Stores <br>Get and work with Information Store Folders Collection <br>Get and work with Folder <br>Get and work with Messages (enumerate, read, delete, make it as read or unread) <br>Work with fields <br>and more <br> Example7<br>(270 KB)<br> In package<br> <br> BY REQUEST<br>(You ask- we create) <br> <br>#1 <br>How to create Appointment/Meeting from DELPHI <br><br>This example show how to create and send Meeting request with CDO and DELPHI. <br><br>The example use as basis Example # 7. <br><br>This is First Lesson created for "By Request" <br><br> CDOAppt<br>(279 KB)<br> In package<br> <br> <br>DELPHI 5 Sources for PART I & II <br>is available after registration <br>(381 KB, Password protected) Register and unlock it<br><br><br> <br><br>Please see also<br> Installing CDO with Outlook and<br> Where to acquire the CDO Libraries (all versions) - http://support.microsoft.com/default.aspx?scid=kb;en-us;171440<br> <br>See "Down to the Metal":<br> Extended MAPI in DELPHI<br> <br>[Other Tools][Home]