Msg.Kit for Delphi – read and write Outlook .msg files

Msg.Kit iconOutlook item files, without Outlook

Msg.Kit reads and writes Outlook item files (.msg, [MS-OXMSG]) without Outlook and without MAPI: the message, its recipients, its attachments and embedded messages at any depth, and every property including the named properties, in the Unicode or the ANSI form of the format. The compound file underneath ([MS-CFB]) is our own reader and writer – no COM, no structured-storage API.

Msg.Kit works on one contract, the message source IMsgSource. A .msg file is one, and so is a message of PST.Kit or MAPI.Kit: whatever takes a message source – the .msg writer, the .eml export, the best body, the property dump – takes a message of any kit.

Delphi 13 Florence · Win32 and Win64 · no Outlook, no MAPI, no COM, no structured-storage API · VCL-free

What Msg.Kit is for

  • Open a .msg file and read it as Outlook shows it: message class, subject, sender, recipients, body, attachments and embedded messages.
  • Write any message as a .msg: a message of a PST file, of a MAPI store or of another .msg – with all its properties, at any depth.
  • Convert files: .msg to .eml, Unicode .msg to ANSI and back.
  • Read the stored properties and the named-property map of a .msg directly.
  • Signed and encrypted messages (S/MIME and OpenPGP) in their [MS-OXOSMIME] shapes – read them, and write them protected, together with Crypto.Kit and MIME.Kit.

How it is organised

  • Reading: MsgKit.Source (a .msg as IMsgSource, OpenMsgSource, MsgFileToEml, MsgFileToMsg) and MsgKit.Reader (the stored properties).
  • Writing: MsgKit.Common.Proxy – TMsgProxy writes any IMsgSource as a .msg – with the bridges PstToMsg.Bridge and MapiToMsg.Bridge for PST.Kit and MAPI.Kit messages.
  • Underneath: the compound file being built, the property streams of the message, its recipients and attachments, and the GUID, entry and string streams of the named-property mapping.
  • Clear rules: a message source of a .msg owns its reader; a TMsgProxy writes once; a damaged file raises ECfbError; every date is local time.

Getting started

A .msg file as Outlook shows it: subject, recipients and attachments:

uses System.SysUtils, Shared.Contracts.MsgSource, MsgKit.Source;

var
  Msg: IMsgSource;
  R: IMsgRecipient;
  A: IMsgAttachment;
begin
  Msg := OpenMsgSource('C:\Mail\Offer.msg');
  Writeln(Msg.MessageClass, ': ', Msg.Subject);
  for R in Msg.Recipients do
    Writeln('  ', R.DisplayName, ' <', R.EmailAddress, '>');
  for A in Msg.Attachments do
    Writeln('  attachment ', A.FileName);
end;

A message of a PST file saved as a .msg (Unicode) and as an .eml; and two one-line conversions:

uses System.Classes, PSTReader.PSTFile, PstToMsg.Bridge, MsgKit.Common.Proxy, MsgKit.Source, MIMEKit;

procedure SaveMessage(AMsg: TPSTMessage; const ABaseName: string);
var
  Proxy: TMsgProxy;
  Eml: TFileStream;
begin
  Proxy := TMsgProxy.Create(AsMsgSource(AMsg));
  try
    Proxy.Save(ABaseName + '.msg');
    Eml := TFileStream.Create(ABaseName + '.eml', fmCreate);
    try
      Proxy.ExportAsEML(Eml);                 // MIME.Kit is linked by the uses clause
    finally
      Eml.Free;
    end;
  finally
    Proxy.Free;
  end;
end;

MsgFileToMsg('C:\Mail\Offer.msg', 'C:\Mail\Offer-ansi.msg', False);
MsgFileToEml('C:\Mail\Offer.msg', 'C:\Mail\Offer.eml');

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

Msg.Kit is developed by IMIBO; the source code is not public. For licensing, custom development or questions write to info@imibo.com.

Msg.Kit Class Reference and Developer Guide (PDF)

Pages of the Msg.Kit Class Reference and Developer Guide

Msg.Kit 1.00 – Class Reference and Developer Guide · PDF, 39 pages, English, October 2026. Introduction, requirements and rules, the units at a glance, getting started, dates and strings, reading and writing .msg files, the message-source contract, the compound file and named-property streams, helpers, signed and encrypted mail, and the road map.

The document is free. Enter your email address and you will receive a personal download link.

Msg.Kit Class Reference and Developer Guide – PDF, 39 pages, English, free.

Enter your email address and we will send you a personal download link (valid 72 hours).


Questions about Msg.Kit: info@imibo.com.

Intelligence Management Interface BackOffice - IMIBO - Logo

Copyright © 2026 IMIBO. Privacy Statement