MAPI.Kit for Delphi – Examples
MAPI.Kit Examples
53 small Delphi projects that show how to work with Outlook and Exchange through MAPI.Kit, the Extended MAPI class library for Delphi. Each example covers one topic, is commented line by line and names the chapter of the MAPI.Kit Class Reference and Developer Guide it belongs to. Many of them do the work of a lesson of the Extended MAPI in DELPHI series – there with the raw Extended MAPI interfaces, here with the MAPI.Kit classes in a few lines.
Four levels
Beginner examples (#1–#8, console)
The environment and MAPI errors, stores, a .pst file without Outlook, the folder tree, reading messages, saving attachments, a new draft, properties.
Intermediate examples (#9–#16 and #28, console)
Outlook items, recurring appointments, restrictions, the address book, named properties, categories, profile administration, copying and moving, sending mail.
Advanced examples (#17–#27, console and VCL)
A mailbox explorer, notifications, Outlook forms, free/busy, permissions, rules and Out of Office, delegates, accounts, Exchange profiles and mailboxes.
GUI applications (#29–#53, VCL, Delphi 10.4 and later)
Programs that look finished – VCL styles, light and dark, every MAPI call on a worker thread: a mail reader, a compose window, a calendar, contact cards, a task board, a property explorer, secure mail, the VCL components of MAPI.Kit and more.
Which data the examples use
The examples never touch your mailbox unless you ask them to. Read-only examples work by default on a copy of the examples’ own test store – a .pst file with a bit of everything (mail with attachments and categories, an HTML mail with an inline image, follow-up flags, appointments and series, a meeting, contacts, tasks, notes, journal entries), built by the first example that needs it. A .pst file named on the command line is opened without Outlook and without a profile; --profile uses the default MAPI profile. Examples that write create a new .pst file in the temporary folder, which you can open in Outlook to look at the result.
Downloads
Every example page offers the compiled program (Win32 and Win64, signed) and the source code of the example; each level page offers all of its examples in one archive. The source code of the examples does not compile on its own: it needs the MAPI.Kit library, which comes in the free DCU packages – one per Delphi version, with the source code of all examples and of the units they share.
Requirements of the programs: Windows with classic Microsoft Outlook of the same bitness as the program (a 64-bit Outlook needs the Win64 program, a 32-bit Outlook the Win32 one). The Exchange examples need a profile with an Exchange account.
Delphi: 10.3 Rio to 13 Florence – Win32 and Win64; the GUI applications 10.4 Sydney and later.
