![]() |
|
| Example # 1 Log in Microsoft Exchange Server and Query User Identity The Extended MAPI is one of the first COM technologies provided by Microsoft. To use any of the extended MAPI functions and/or interfaces (with very few exceptions), before we do anything, we should initialize the Extended MAPI subsystem. For this purpose Microsoft provides the MapiInitialize function. Through this function MAPI initializes the COM system by calling CoInitialize internally. In this example: How to
How to use the HrOpenSessionObject function for retrieving a MAPI IMAPIProp interface for the current session object (user) and get all existing user properties. Example01EM(342 KB) as Compiled Application DELPHI 6 preview Project(DELPHI 6) ZIP file Source Code: In package |
![]() |
Example # 2 Retrieve Microsoft Exchange GAL (Global Address List) This example will show you how to get access to GAL (Global Address List) The GAL is a single address list that contains all addresses defined at a Microsoft Exchange Server. GAL was presented for the first time in Microsoft Mail postoffice - one of Microsoft's first attempts to provide to users an option allowing them to exchange messages and files not by simply using shared directories and files. For Mail users, the GAL's main purpose is to provide a single list where users can find all the addresses they can send mail to. Users do not need to know the location of the user to whom they want to send mail. Global Address List is a MAPI address book container that holds recipient entries for an entire organization and is available to all e-mail users in that organization. We will learn how to use the following interfaces: IAddrBook - The IAddrBook interface supports access to the MAPI address book and includes operations such as displaying common dialog boxes, opening containers, messaging users, and distribution lists, and performing name resolution. IABContainer - The IABContainer interface provides access to address book containers. MAPI and client applications call the methods of IABContainer to perform name resolution and to create, copy, and delete recipients. IMAPITable - The IMAPITable interface is used to provide a read-only view of a table. IMAPITable is used by clients and service providers to manipulate the way a table appears. We will study in more details the following memory management functions - MAPIAllocateBuffer, MAPIAllocateMore, MAPIFreeBuffer, FreePRows. These functions are used actively in all applications using MAPI. We will study the way MAPI Hierarchy Table and MAPI Content Table are used. We will focus our attention on the ENTRYID structure and how to work with binary MAPI objects, as well as how to work with MAPI Rows and Columns. We will not forget the restrictions we can apply. Include some steps from Example #1 and How to
Example02EM(328 KB) as Compiled Application Source Code: In package |
![]() |
Example # 3 Retrieve Microsoft Exchange "Light" Hierarchy (by Global Address List) In the previous example we illustrated how to connect to Microsoft Exchange Server, how to obtain the GAL content and to display basic properties of the e-mail user such as PR_DISPLAY_NAME and PR_EMAIL_ADDRESS. In the current example we will review the Hierarchy tables. Through them we may build a tree that displays Exchange Organization (5.5). A hierarchy table contains information about the containers in an address book container. Each row of a hierarchy table contains a set of columns with information about address book container. Hierarchy tables are implemented by address book providers to show a tree of containers within the address book. Containers that cannot hold subcontainers, as indicated by the absence of the AB_SUBCONTAINERS flag in their PR_CONTAINER_FLAGS property, do not implement a hierarchy table. We will also learn how we can turn the PSBinary data in a more user-friendly data type, such as String (for visualization). We will not take time to explain the usage of functions and data that were discussed in the previous examples. This example requires connection to Microsoft Exchange Server for efficient implementation. How to
Example03EM(328 KB) as Compiled Application Source Code: In package |
![]() |
Example # 4 Writing a small Hierarchy Viewer So far in the previous examples we learned how to connect to Exchange Server, how to display our Properties in Address Book, to obtain the GAL contents, and see the embedded containers. We learned how to work with Content and Hierarchy Table, as well as with basic interfaces. Now we will try to include all this in one example that will be a GAL Viewer. In this example we will write small GAL Hierarchy Viewer. What should do it: - show GAL - show Hierarchy - show Organization - show Organization default properties - show Sites - show it properties - show Containers in each Site - show it properties - show recipients in each container - show default properties for each recipient. Example04EM(328 KB) as Compiled Application Source Code: In package |
![]() |
![]() |
Example # 5 Log in Microsoft Exchange Server/Outlook and Getting Exchange Private Store Tree In the previous examples we focused our attention to working with GAL. In the following several examples we will study Message Store. Message Store stores the e-mails and other user information. Message Store is organized as hierarchical system and its architecture "repeats" the file system. The message store is implemented in multiple levels, with containers called folders holding messages of different types. There is no limit to the number of levels in a message store; folders can contain many subfolders. Client application users can access a summary view of the messages contained within each folder or view them individually with a form. Message store data can be used in a variety of ways. Besides the traditional electronic mail usage, folders can be used as a forum for public discussion, as a repository for reference documents. Each Message store must contain a special folder called Root. When you start Outlook for the first time, it will create in the Root folder several special folders - "Top of Personal Folders", "Search Root", that contain Custom and Default View. All folders you can see in Outlook, such as Inbox, Outbox, Sent Items, Deleted Items, Calendar are in "Top of Personal Folders". They are known as IPM subtree (interpersonal message subtree).... In this example we will write small Exchange Private Store (mailbox) Hierarchy Viewer. How to:
Example05EM(330 KB) as Compiled Application Source Code: In package |
![]() |
Example # 6 Getting Exchange Mailbox and enumerate items (messages) in each folder In the preceding example we saw the structure (tree) of our MailBox. Now we will try to show the contents of each folder. Most people think of e-mails as messages. However, MAPI perceives each element in a folder as a message. The calendar, letters, contacts - all these are messages of different classes. But we will discuss this later. Now, let's get to what we want to do - visualize the contents of a folder. When we select a folder in the MailBox, we will show its contents in the right-hand window. This task will be performed by the EnumThisFolder function.... How to:
Example06EM(330 KB) as Compiled Application Source Code: In package |
![]() |
Example # 7 Now, we will get a message from folder and... In this example we'll not only show the contents of a folder, but we will also be able to open each element in it. Since MAPI perceives each entry in the Content Table as a Message, we will not take into consideration the Message object class. How to:
Example07EM(338 KB) as Compiled Application Source Code: In package |
![]() |
![]() |
Example # 8 How to create AdviseSink to message store (Event Notification in MAPI) The purpose of this example is to show the possible ways to get notification, when an event occurs with our Mailbox Store. E.g. a new e-mail receipt, deleting, changing objects, etc. Why do we need this? Sometimes the incoming messages have to be stored as archive, e.g. in SQL DataBase, by a defined property - sender, message subject, words in the e-mail text. This may be performed automatically namely in this manner. In other cases, when we have an incoming e-mail, its contents or part of it will be redirected to another outlet - e.g. SMS* gateway, or FAX Service. Or, you have to update your TlistView when a MAPI object has been deleted, changed, copied, created. For this purpose MAPI provides an IMAPIAdviseSink interface as well as several functions for the creation of an AdviseSink object and for its attachment to the MAPI SubSystem. In the general case the AdviseSink object is attached to MAPI tables and traces the occurrence of any of the following events: - fnevCriticalError - A global error has occurred, such as a session shut down in progress. - fnevNewMail - A message has been delivered to the appropriate receive folder for the message class and is waiting to be processed - fnevObjectCreated - A MAPI object has been created - fnevObjectDeleted - A MAPI object has been deleted - fnevObjectModified - A MAPI object has changed - fnevObjectCopied - A MAPI object has been copied - fnevSearchComplete - A search operation has finished and the results are available - fnevTableModified - Information in a table has changed - fnevExtended - An internal event defined by a particular service provider has occurred When an event occurs, the MAPI Subsystem informs the AdviseSink object via its "callback" function IMAPIAdviseSink.OnNotify We will build our own COM object that implements IMAPIAdviseSink, we will inform the COM subsystem of its presence upon starting the program, and we will connect to MsgStore and monitor for a new message. The Delphi code that performs this is in the IMIMailNotifier.pas file. We have implemented in it TMAPIAdviseSink = class (TCOMObject, IMAPIAdviseSink) and TMailNotifier = class (TObject) The code that we will implement is based on COM technologies and the IMAPIAdviseSink object, and it eliminates any usage of TTimer components. If used profile is connected to Exchange Server, you no need to start the Outlook. If you use IMO (internet mode only) Outlook, then Outlook, should be running (somebody should receive e-mails).
Source Code: In package |
![]() |
Example # 9 How to work with MAPI Profiles [Original C++ code is written by Sam Charchi Microsoft Developer Support see SAMPLE: Profman2.exe - MAPI Profile Manager v2.0] This sample, Profman v2.0, was created to demonstrate how to use the MAPI interfaces and methods that pertain to the manipulation and creation of MAPI profile. Example is based on Microsoft Profman 2.0 Application. In this example whose original C code is written by Microsoft you may study the original Microsoft technology of writing. We tried to stay as close as possible to the original code, however, at the points where we couldn't stand it any longer, we used DELPHI techniques. We have left the original comments of the Microsoft developers. Its functionality is as follows: 1. Creates a new blank profile. 2. Adds services to a profile. 3. Deletes services from a profile. 4. Lists the services in a profile. 5. Adds providers to a service. 6. Deletes providers from a service. 7. Lists the providers in a service. 8. Lists the available properties of a service (even those that are normally inaccessible). 9. Lists the available properties of a provider (even those that are normally inaccessible). Example09EM(386 KB) as Compiled Application Source Code: In package |
![]() |
![]() |
Example # 10 How to allow users to change their profile details on the exchange server In this example we will go back to GAL for a short while. In many cases, the Exchange Server administrators do not have the time to fill in all fields describing the users, such as Address, City, State, Zip Code, Country, Title, Company, Department, Office, Assistant... This may be performed successfully using MAPI. For this purpose we need to take an interface to the user that is listed in GAL. To this end most convenient is IMAPIProp, since IMailUser and IDistList implement IMAPIProp. Once you compile this program, you may provide it to all users so they can update their ID data themselves. To update their attributes, users need to have special rights. We will try to go round them, however, if you get a message that you do not have the right to do this, or that you do not have sufficient rights, you may do the following procedure as described in "XADM: How to Use the GAL Modify Tool" http://support.microsoft.com/?kbid=272198 Allow users to change:
Example10EM(330 KB) as Compiled Application Source Code: In package |
![]() |
![]() |
Request # 1 How to call integrated dialogs in Address Book provider from DELPHI Since we were asked how one can visualize the AddressBook integrated into Outlook, we developed this small example. With it we will start our new section "Applications upon request". MAPI provides 2 types of inbuilt address dialog boxes - modal and non-modal. It also provides a dialog box for entering new a-mail addresses - New Entry dialog box. In our example we will review the first two. ByRequest01EM as Compiled Application Source Code: In package |
![]() |
Request # 2 How to build SIMPLE Mailbox reader (agent) with CDO and DELPHI We receive many questions, how with CDO (Microsoft Collaboration Data Objects) a developer working on Borland DELPHI can access the Microsoft Exchange Server Information Store. It is easy. A small and very simple MAIL reader can be build for 30-40 minutes (assumed that you know DELPHI and CDO, and have 5-10 minutes for a coffee or tea). The sample below (Simple MAIL Reader) demonstrates how-to:
ByRequest02EM as Compiled Application Source Code: In package |
![]() |
Request # 3 How to save attachments and messages from DELPHI We received questions how the messages and attachments can be saved on the local disk, so we developed this small example. It is based on a previous example, and we added a new functionality in unit unfrmmessage How with Extended MAPI a developer working on Borland DELPHI can save attachments and messages w/o using slow Outlook Automation and get Contact/Appointment/E-mail/Journal/Task Subject using Extended Mapi without the security warnings. ByRequest03EM as Compiled Application Source Code: In package |
![]() |
Request # 4 How to send attachments and messages from DELPHI In this example that we have developed upon users' request, we have added a functionality for creating and sending a new message. This is done in unit unNewMess. Please note that MAPI spooler is not used in version 10 of Outlook and above, so the message waits in the Outbox folder, unless we are connected to Exchange Server, or Outlook is running. When the profile that we use has performed a session with Exchange Server, the message is sent and saved in the Sent Items folder Also: - Save message to outbox folder. - Add attachments. - Use integrated Address Book - Use TO: CC: BCC: - Resolving Names ... ByRequest04EM as Compiled Application Source Code: In package |
![]() |
![]() |
Request # 5 How to implement Extended MAPI in NT Service Application with DELPHI In this example we will implement NT Service using Extended MAPI in itself. There are two specific characteristics of using Extended MAPI in this case: - the first is a special flag that informs the MAPI Subsystems hat we are going to work in a service environment - the second is the fact that when the service works with the rights of a user other than the interactive one, we need to create a MAPI Profile dynamically and erase it once we have completed the session through MAPILogonEx. Our service will register the new incoming messages in a certain mailbox in NT Event Log. You may of course change the functionality of the example according to your needs.
ByRequest05EM as Compiled Application Source Code: In package |
![]() |
Request # 6 How to Read, Delete and Send messages from DELPHI How with Extended MAPI a developer working on Borland DELPHI can manage messages with attachments. ByRequest06EM Source Code: In package |
![]() |
Request # 7 How to use integrated MAPI Forms from DELPHI (Loading and Creating a Message Into a Form) In this example we will show you how to use the forms embedded in Extended MAPI. We will be able to show the elements in our Mailbox - e-mails, notes, calendar entries,contact entries - in the form that we have used to working with Outllok. We will learn how to use the following interfaces: - IMAPIFormMgr - IMAPIMessageSite - IMAPIFormInfo - IMAPIForm - IPersistMessage - IMAPIViewContext We will build a class called TMAPIFormViewer that implements in itself TInterfacedObject, IMAPIMessageSite, IMAPIViewContext, IMAPIViewAdviseSink. We will use the capacity of IMAPIAdviseSink to visualize the changes that occur in case of erasing, adding or changing items in the MsgStore container. We will develop a function that will enable us to open a saved Message From the file system. All w/o using Outlook automation and security warnings! Using the PrepareForm and ShowForm strategy is comparatively easy. Support both type of MAPI forms - MODAL and NOT MODAL Also:
Source Code: In package |
![]() |
Request # 8 How to use Personal folder (*.PST) files from DELPHI (Loading and Creating a *.PST) How with Extended MAPI a developer working on Borland DELPHI can create or/and load a PST file without existing MAPI profile. Then you can use this *.PST as your Private Store, that hold secret data. Personal Information Stores - PST files - offers ideal opportunities for storing our correspondence in one place. This example will illustrate how to create/open PST files. In addition, we will illustrate how to copy/move/erase messages and folders. We chose to illustrate this here, since it is assumed that the PST file will not contain significant information and we may fidget with the data. We will show you how to implement the IMAPIProgress class that MAPI provides for the process visualization. With it you may, for instance, build an indicator that will show the process of copying 10 000 e-mails from one folder into another. The user will be able to monitor the process and will not be bored - something is "moving" there :-) Also:
ByRequest08EM as Compiled Application Source Code: In package |
![]() |
Request # 9 How to get access to Exchange Public folders from DELPHI This example (By Request #9) will show you how to get access to public folders. This example requires connection with Exchange Server for efficient implementation. ByRequest09EM as Compiled Application Source Code: In package |
![]() |
Request # 10 Extended MAPI DCOM NT Server as Service The idea behind this example is to implement a MAPI object that works as a COM Server in Windows NT Service. Our MAPI COM Server will perform basic things - LogOn, LogOff and will take all the messages from the Inbox folder. Start up parameters of this NT Service are PROFILENAME and PROFILEPASSWORD. We will also create a test client enabling us to check how our server works. Why do we need this example? For instance, you may create a perfectly normal DCOM client with DELPHI that uses Extended MAPI and is placed on some user's computer. This client may have connection to GAL for instance or to Contacts Folders through our NT Service. This may be for instance the Front Desk girl for whom we need to install an e-mail client or it may be used by the HR department for updating data. This NT Service may also be used by ASP pages through VB scripts. You can use also for better result SvCom package from ALDYN Software SvCom is an integrated package of classes and tools for development of service applications and use of NT Security framework. Currently SvCom components work with Delphi 4, 5, 6, 7 and 2005 and C++ Builder 5 and 6 under all flavors of Windows. ... procedure TMAPIActiveXService.ServiceBeforeInstall(Sender: TService); begin ServiceStartName := FindMySwitch('USERNAME', ['-', '/']); LogMessage(ServiceStartName, 0); Password := FindMySwitch('USERPASS', ['-', '/']); end; procedure TMAPIActiveXService.ServiceAfterInstall(Sender: TService); begin try RegAction := raReg; RegisterEXE; RegisterAsService(GUIDToString(CLASS_MAPICOMServer), self.Name); except on e: Exception do if e.Message <> '' then MessageBox(0, PChar(e.Message), 'MAPI ActiveX Service', MB_OK or MB_ICONERROR or MB_SERVICE_NOTIFICATION); else MessageBox(0, 'Can not install "MAPI ActiveX Service" service!', 'MAPI ActiveX Service', MB_OK or MB_ICONERROR or MB_SERVICE_NOTIFICATION); end; end; .... ByRequest10EM as Compiled Application Source Code: In package |
![]() |
Request # 11 Get all available Message Stores in our MAPI Profile This example (By Request #11) will show you how to get access to all message stores listed in our MAPI profile. This includes also Delegated Mailbox. This example requires connection with Exchange Server for efficient implementation. ByRequest11EM as Compiled Application Source Code: In package |
![]() |
![]() |
Request # 12 Exchange ACL (Modifying Access Rights) Public Folders Access Control Access to Exchange server public folders is protected by custom mechanism. Although an object, which represents a folder in the Directory may have an associated Windows NT security descriptor with DACL in it, client access is controlled by an access control list of another kind. There is a bit of confusion here because both are called ACLs. The difference is that a Windows NT ACL specifies rights for Windows NT accounts, while a public folder ACL deals with MAPI PR_ENTRYIDs. I have a separate topic How NT Access Control Relates to Public Folder ACLs that describes where these two things come together. You can access public folder ACLs via either IExchangeFolderACLs interface, or IExchangeModifyTable. We have written a few samples that illustrate both approaches. Also, MSDN has a sample named ACLEDIT, which illustrates usage of IExchangeFolderACLs. Access Rights The following code fragment extracted from the Edk.pas file lists documented access rights. //Security bits const frightsReadAny = ULONG($0000001); frightsCreate = ULONG($0000002); frightsEditOwned = ULONG($0000008); frightsDeleteOwned = ULONG($0000010); frightsEditAny = ULONG($0000020); frightsDeleteAny = ULONG($0000040); frightsCreateSubfolder = ULONG($0000080); frightsOwner = ULONG($0000100); frightsContact = ULONG($0000200); rightsNone = ULONG($00000000); rightsReadOnly = frightsReadAny; rightsReadWrite = (frightsReadAny or frightsEditAny); rightsAll = ULONG($00001FB); The table below explains their meanings:
In addition to these rights Exchange server uses flag $0000400, which determines folder visibility to a user. This flag is not a member of rightsAll. Roles Microsoft Exchange server uses a few roles for public folder clients. Roles are convenient combinations of individual access rights. The following roles are defined:
You may easily determine which individual rights contribute to the role by examining it access mask. Who May Be Listed in an ACL? The following entities may be listed in a public folder ACL:
ByRequest12EM as Compiled Application Source Code: In package |
![]() |
Request # 13 Out Of Office (Auto Replay Message, Message Rule) This step-by-step article describes how to create an out-of-office rule with Extended MAPI. How to:
This example requires connection with Exchange Server for efficient running. ByRequest13EM as Compiled Application Source Code: In package |
![]() |
![]() |
Request # 14 Outlook Folders (Inbox, Outbox, Sent Items, Deleted Items, Calendar, Contacts, Journal, Notes, etc...) This example (By Request #14) will show you how to get direct access to Microsoft Outlook specific folders as Calendar, Contacts, Notes, etc.. Example includes functions as:
ByRequest14EM as Compiled Application Source Code: In package |
![]() |
![]() |
Request # 15 Fast E-mail Agent Very often we receives a requests for a code by which a few lines written in Delphi can sent e-mail using Microsoft Exchange Server as e-mail server. This example covers exactly that. procedure TfrmMain.LogonAndSend; var StoreLogoffFlag:Cardinal; OutboxEntryID: TSBinary; ObjType:Cardinal; SentMailEID: PSPropValue; TempString:String; begin ZeroMemory(@OutboxEntryID, SizeOf(OutboxEntryID)); SentMailEID:=nil; // Init MAPI Subsystem hr:=MAPIInitialize(nil); if failed(hr) then raise Exception.Create(GetMAPIError(nil, hr)); try //Establish Session hr:=MAPILogonEx(Application.Handle, //Parent Window nil, //Profile name nil, //Profile password - newer used MAPI_EXTENDED or {/* Extended MAPI Logon */} MAPI_NEW_SESSION or {/* Don't use shared session */} MAPI_SERVICE_UI_ALWAYS or MAPI_ALLOW_OTHERS or {/* Make this a shared session */} MAPI_LOGON_UI, {/* Dialog box should be displayed */} FMAPISession); if failed(hr) then begin FMAPISession:=nil; raise Exception.Create(GetMAPIError(nil, hr)); end; // NOT NEED REALLY, BUT I LIKE TO KNOW MAPI VERSION StatusBar.SimpleText:=' MAPIVersion:' + GetMAPIVersion; //Get interface to Address Book hr := FMapiSession.OpenAddressBook(Self.Handle, nil, 0, FAddressBook); if failed(hr) then raise Exception.Create(GetMAPIError(FMapiSession, hr)); //Get interface to Mailbox hr := HrOpenExchangePrivateStore(FMapiSession, FMailbox); if failed(hr) then raise Exception.Create(GetMAPIError(FMapiSession, hr)); //Get Entry ID of Outbox folder hr := HrMAPIFindOutbox(FMailbox, OutboxEntryID.cb, PEntryID(OutboxEntryID.lpb)); if failed(hr) then raise Exception.Create(GetMAPIError(FMailbox, hr)); //Get Interface to Outbox folder hr := FMailbox.OpenEntry(OutboxEntryID.cb, PEntryID(OutboxEntryID.lpb), @IID_IMAPIFolder, MAPI_MODIFY or MAPI_NO_CACHE, ObjType, IUnknown(FOutbox)); if (MAPI_E_UNKNOWN_FLAGS = hr) then // Outlook Version < 2003 hr := FMailbox.OpenEntry(OutboxEntryID.cb, PEntryID(OutboxEntryID.lpb), @IID_IMAPIFolder, MAPI_MODIFY, ObjType, IUnknown(FOutbox)); if failed(hr) then raise Exception.Create(GetMAPIError(FMailbox, hr)); // Get Sent Items Folder - we will move message to this folder after submit // not mandatory - see below hr := HrGetOneProp(FMailbox, PR_IPM_SENTMAIL_ENTRYID, SentMailEID); if failed(hr) then raise Exception.Create(GetMAPIError(FMailbox, hr)); SentMailEID.ulPropTag := PR_SENTMAIL_ENTRYID; // Create a new empty message hr := FOutbox.CreateMessage(nil, 0, FMAPIMessage); if failed(hr) then raise Exception.Create(GetMAPIError(FOutbox, hr)); // Set Message Class hr:=HrMAPISetPropString(FMAPIMessage, PR_MESSAGE_CLASS, Pointer(PChar('IPM.Note'))); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); // Set Sent Items Entry ID - not mandatory hr:= HrSetOneProp(FMAPIMessage,SentMailEID); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); // Set Message Subject TempString:=Trim(ebSubject.Text); if TempString='' then TempString:='Test Message'; hr:=HrMAPISetPropString(FMAPIMessage, PR_SUBJECT, Pointer(PChar(TempString))); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); // Set Message Body TempString:=Trim(BodyMemo.Text); if Length(TempString)>254 then SetLargeBody else if Length(TempString)>0 then begin hr:=HrMAPISetPropString(FMAPIMessage, PR_BODY, Pointer(PChar(TempString))); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); end; //Set Recipients Resolve; // Save all changes hr := FMAPIMessage.SaveChanges(KEEP_OPEN_READWRITE); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); // Send Message hr := FMAPIMessage.SubmitMessage(0); if failed(hr) then raise Exception.Create(GetMAPIError(FMAPIMessage, hr)); ShowMessage('The message is going out...'); finally //Clear Sent Item Entry ID if Assigned(SentMailEID) then MAPIFreeBuffer(SentMailEID); //Clear Outbox EntryID if Assigned(OutboxEntryID.lpb) then MAPIFreeBuffer(OutboxEntryID.lpb); //Clear Outbox Interface FOutbox:=nil; //Clear Message Interface FMAPIMessage:=nil; FAddressBook:=nil; if Assigned(FMailbox) then begin StoreLogoffFlag:=LOGOFF_NO_WAIT; FMailbox.StoreLogoff(StoreLogoffFlag); FMailbox:=nil; end; if Assigned(FMAPISession) then FMAPISession.Logoff(Application.Handle, MAPI_LOGOFF_UI, 0); // always 0 FMAPISession:=nil; end; MAPIUnInitialize; end; ByRequest15EM as Compiled Application Source Code: In package |
|
![]() |
Request # 16 DateTime restriction and Appointments This example shows how to construct DateTime restriction. With this restriction we will limit the listed Appointments to certain time interval. ByRequest16EM as Compiled Application Source Code: In package |
![]() |
Experimental # 1 MAPI .msg <-> MIME .eml (MAPI-MIME Conversion API) This "experimental" example allows conversions between MIME and MAPI messages. Starting with Microsoft Office 2003, Microsoft offers a COM library and interfaces as IConverterSession. Interface is not fully documented from Microsoft, but you are able to use it... Experimental01EM as Compiled Application Source Code: In package |
![]() |
![]() |
Experimental # 2 "Smart" Mailer Long time ago, we received a request for developing a very simple method for sending messages with attachments and HTML body. We decided that the "best" solution will be a custom class based on TObject. What's easier than that: // Send Message with TMailer.Create(Application) do try SendMail(ListBoxTO.Items, // TO recipients - can be nil ListBoxCC.Items, // CC recipients - can be nil ListBoxBCC.Items, // BCC recipients - can be nil ListBoxAttachements.Items, // Attachments - can be nil Trim(ebSubject.Text), // Subject - optional BodyText, // Message Body - Plain - optional BodyHTML, // or Message Body as HTML - optional cbConfirmRead.Checked, // RECEIPT REQUESTED - optional True // Move to Sent Items folder??? - optional ) finally Free; end; Experimental02EM as Compiled Application Source Code: In package |
![]() |
![]() |
Experimental # 4 Public Free Busy Do you know that: - Free/busy data is derived from calendar data and falls into four categories: Free, Busy, Tentative and Out of Office (OOF). - It is not necessary to "enumerate" each Mailbox to get those data - For an arbitrary user, you can generally access free/busy data in the Public Folders. You can to access the information directly from the IMAPIFolder Contents Table from the Public Folder. The Public Folder Based Free/Busy data assumes that the server is configured to support public folders. Experimental04EM as Compiled Application Source Code: In package |
![]() |
![]() |
Experimental # 5 We accept Microsoft Office Outlook Drag&Drop There is no need to use third-party components to implement Drag-And-Drop of Messages from Microsoft Office Outlook. Preserving our understanding that all you need is available from Delphi and Windows, we offer this example. Just run it and Drag-And-Drop *.msg from the file system, or Message from Microsoft Office Outlook. That is all ... Experimental05EM as Compiled Application Source Code: In package |
![]() |
![]() |
Experimental # 6 What is the Best Body? In the beginning, when the e-mail revolution was conceived - it was easy - the body of the messages was only as "simple" text. Over time, a consumer wants to see the important things in messages in different ways, to have pictures, embedded objects ... And of course, IT companies are responding to their wishes. But this led to a situation in which messages contain "Plain", "Rich", "HTML" version of the body. And this entire - for compatibility. Currently, many developers ask: "How to get the best format for the message body?" PR_BODY, PR_RTF_COMPRESSED, PR_HTML? What is the "Best"? This example application is trying to answer all these questions. More over: - There is not any third-party components for displaying HTML messages. - Pure virtual list - no need to downloads the entire list of received messages, it is not necessary to use auxiliary structures - let's MAPI to work for us - the fastest and most elegant way for the visualization of large lists - so that your Inbox may contain as few hundred or thousands of messages. - Quickly and elegantly sorting by Subject, Sender, Date, Size, etc ... Note: Part of included code is based on Best Body Retrieval Protocol Specification Experimental06EM as Compiled Application Source Code: In package |
![]() click for enlarged view |
| REGISTRATION | |
After registration you will receive source code of examples and useful library.
|
|
|
||||||||||||
|
||||||||||||
|
|
||||||||||||
|
Valid MAPI profile to Microsoft Exchange Server are required for property starting of some examples. |
||||||||||||
|
Register and unlock it |
Customer Care Center and FAQ |
|
||||||||||
|
Refund Policy and
Cancellation There is NO refund policy attached due to the nature of this package. When you gain access to this source code, you have virtually unlimited possibilities of doing anything (or nothing) with it. Having said that, we won't have any idea as to what you will do next. So if you perceive this Policy as risky because of the "no refund" policy or don't have any solid plans with the source code or you are lazy "component based" developer, we would kindly advise you NOT to purchase this package. Extra Custom Development is available thru our Extended Consulting Service |
|||||
| All examples (compiled with DELPHI
2010) you can download from here (size: about 17 MB) The Extended MAPI officially is NOT supported by Microsoft inside .NET Framework. That means that you cannot use our source codes with DELPHI 8 / DELPHI 2005 dot NET. We cannot find reason our team to participate in this BIG experiment named dot NET. For more information please see the Microsoft web site - Support policy for Microsoft Exchange APIs with the .NET Framework applications. The Messaging API is a COM-like API that provides access to the contents of messaging stores. Using either CDO or MAPI, a program can connect to a MAPI store, and then perform operations against that store. Starting with Exchange 2007, Microsoft will distribute the MAPI client libraries and CDO 1.2.1 as a Web download - Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 - from Microsoft WEB site See also Down to the Metal (MAPI Service Providers in DELPHI)
|
|||||
|
We strongly recommends
OutlookSpy -
the Ultimate Outlook
Developer Tool. Whether you work with Extended MAPI or Outlook Object Model or CDO, OutlookSpy will help you find exactly what you are looking for.
|
|||||
| Looking for something specific that we don't currently offer? Send us your Product Wish List and our developers will use your feedback when building the upcoming versions. At IMIBO we'll be pleased to create this masterpiece of code which explicitly fits your needs. We offer individual consulting services to optimize the organization of your development processes. Call us today! Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. |
|||||
Copyright © 2012 IMIBO |