Exchange Online and Outlook.com mailboxes – mail, calendar, contacts, To Do
Graph.Kit reads and writes the Outlook mailboxes of Exchange Online (Microsoft 365) and Outlook.com through Microsoft Graph v1.0: the mail folder tree, messages with their attachments and their MAPI properties, sending with attachments up to 150 MB, calendars, meetings and their answers, free/busy, contacts, Microsoft To Do tasks, change tracking (delta), JSON batching, the translation of ids between Graph, EWS and MAPI, and the mailbox settings (automatic replies, inbox rules, categories).
A message read through Graph is an IMsgSource like the messages of every other kit: it is saved as .msg by Msg.Kit and as .eml by MIME.Kit, and checked against MAPI.Kit on the same mailbox the two kits give the same properties, recipients and attachments. The user signs in on Microsoft’s own page in the system browser – the program never sees a password.
Delphi 13 Florence · Win32 and Win64 · Microsoft Graph v1.0, WinHTTP, System.JSON · no MSAL, no Graph SDK, no Outlook, no OpenSSL, no Indy · VCL-free
What Graph.Kit is for
- Read a mailbox without Outlook: folders, messages, bodies, recipients, attachments and the MAPI properties Graph stores, saved as .msg or .eml.
- Send mail with large attachments (upload sessions up to 150 MB), reply, forward, move, flag and categorise messages.
- Calendars and meetings: events with recurrence, invitations, cancellations and answers, the occurrences of a time window, free/busy.
- Contacts and Microsoft To Do tasks, read into and written from the same neutral records the other service kits use.
- Keep a local copy up to date with delta rounds; send up to 20 requests in one JSON batch; translate ids between Graph, EWS and MAPI.
- Mailbox settings: automatic replies (out of office), inbox rules, the master category list.
How it is organised
GraphKit.Session– one signed-in identity (an OAuth 2.0 token provider of the shared units: browser sign-in with PKCE or device code; the refresh token optionally in the Windows Credential Manager);GraphKit.Mailbox–/meor another user’s mailbox, the entry to everything else.- Mail:
GraphKit.Folders,.Messages,.Attachments,.Writerand.Source(theIMsgSourceof a Graph message). GraphKit.Calendar,.Contacts,.Tasks,.Sync(delta, batching, ids),.Settings, andGraphKit.MailboxSource– the whole mailbox behind the kit-neutralIMailboxSourcea viewer is written against.- In the shared units: the REST client over WinHTTP (retries after Retry-After, paging, the OData error body), the OAuth 2.0 client, the neutral write records
TMailDraft,TAppointmentDraft,TContactDraft,TTaskDraft, and the Graph names of the MAPI properties from the one property catalogue of the toolkit. - Clear rules: every date-time of the API is local time; immutable ids (an item keeps its id when it is moved); what a mailbox hands out belongs to it; tokens are never written to a trace or a log.
Getting started
Sign in once with the browser, then list the newest messages:
uses Shared.Net.OAuth, Shared.Net.OAuth.Provider, GraphKit, GraphKit.Session, GraphKit.Mailbox,
GraphKit.Messages;
var
Options: TOAuthOptions;
Session: TGraphSession;
Mailbox: TGraphMailbox;
Msg: TGraphMessage;
begin
Options := GraphOAuthOptions('fred@contoso.com');
if GraphHasStoredToken(Options, 'fred@contoso.com') then
Session := TGraphSession.Create(GraphStoredTokenProvider(Options, 'fred@contoso.com'))
else
Session := TGraphSession.Create(GraphSignInWithBrowser(Options, True));
Mailbox := TGraphMailbox.Create(Session);
try
for Msg in Mailbox.Inbox.Messages(10) do
Writeln(Msg.ReceivedDateTime, ' ', Msg.Subject);
finally
Mailbox.Free;
Session.Free;
end;
end;
A message with a large attachment, then a weekly meeting for four weeks:
var
D: TMailDraft;
A: TAppointmentDraft;
begin
D := Default(TMailDraft);
D.Subject := 'Report';
D.Body := TItemBody.Html('<p>See the file.</p>');
D.AddTo('ann@contoso.com', 'Ann');
D.AddAttachment(TItemAttachment.FromFile('C:\Temp\report.zip')); // up to 150 MB
Mailbox.SendMail(D);
A := TAppointmentDraft.Create('Planning', Date + 1 + EncodeTime(10, 0, 0, 0),
Date + 1 + EncodeTime(11, 0, 0, 0));
A.AddAttendee('ann@contoso.com');
A.Recurrence := TItemRecurrence.Weekly([oMonday]).EndingAfter(4);
Mailbox.DefaultCalendar.CreateEvent(A).Free;
end;
More examples, the rules of ownership, errors and time zones, and every class, property, method and routine are in the Class Reference and Developer Guide.
Part of the IMIBO mail toolkit
Every kit gives the same answer for the same message: the kits share one property catalogue, one message contract and one JSON property dump, so a message read by one kit can be written, converted or compared by any other.
MAPI.Kit · PST.Kit · Msg.Kit · MIME.Kit · Crypto.Kit · Autodiscover.Kit · Graph.Kit
Graph.Kit is developed by IMIBO; the source code is not public. For licensing, custom development or questions write to info@imibo.com.
Graph.Kit Class Reference and Developer Guide (PDF)

Graph.Kit 1.00 – Class Reference and Developer Guide · PDF, 63 pages, English, October 2026. Introduction, requirements and rules, the units at a glance, getting started, the Graph.Kit guide (sign-in, conventions, folders and messages, sending, calendar, contacts and tasks, change tracking, batching, ids, mailbox settings), the class chapters, the neutral item models and the shared REST / OAuth layer.
The document is free. Enter your email address and you will receive a personal download link.
Questions about Graph.Kit: info@imibo.com.
Example application: GraphInspectorLite (free download)
GraphInspectorLite is a free, read-only viewer of Microsoft 365 and Outlook.com mailboxes written with Graph.Kit – an example of what the kit is for, in the style of PST Inspector: the accounts with their folder trees, the items of a folder page by page with sorting and server-side search, the MAPI properties, recipients and attachments of every item, messages with a safe HTML view (no scripts, external pictures blocked until you allow them), Save as .msg / .eml, calendars, contacts and To Do lists, light and dark themes. It asks Microsoft only for read permissions and never changes the mailbox.
The download (ZIP, 6.5 MB) contains:
Win64\GraphInspectorLite.exeandWin32\GraphInspectorLite.exe– the program, no installation (with Microsoft’sWebView2Loader.dllnext to it).Source\– the complete source code of GraphInspectorLite (Delphi 13, VCL): the project, its units and forms, the icon.UserGuide.mdandREADME.txt.
Note: The ZIP holds the executable and the source code of the program, but not the libraries it is built on – Graph.Kit, the shared units, Msg.Kit and MIME.Kit; to compile the source you need those kits.
Enter your email address and you will receive a personal download link.
Questions about GraphInspectorLite: info@imibo.com.

