MIME.Kit for Delphi – .eml, S/MIME, PGP/MIME, iCalendar and vCard

MIME.Kit iconInternet message formats for Delphi

MIME.Kit is the toolkit’s home for Internet message formats. It reads and writes MIME messages (.eml, RFC 5322 and RFC 2045–2049, with RFC 2047 / 2231 / 6532 for international text), turns any message of the other kits into an Internet message by the mapping of [MS-OXCMAIL], and writes appointments, meetings and tasks as iCalendar and contacts as vCard.

Signed and encrypted messages are recognised, verified, decrypted and written: S/MIME (RFC 8551), PGP/MIME (RFC 3156) and, when reading, inline PGP. MIME.Kit depends only on the RTL, the Windows API and the shared units – no Indy – and the other kits reach it through a small facade.

Delphi 13 Florence · Win32 and Win64 · no Outlook, no MAPI, no COM, no Indy · VCL-free

What MIME.Kit is for

  • Parse an .eml tolerantly – bare LF, 8-bit headers, broken encoded-words and missing boundaries are accepted – and write only the strict form.
  • Build messages: addresses, international subjects, text and HTML bodies, attachments, embedded messages.
  • Export a message of PST.Kit, Msg.Kit or MAPI.Kit as an .eml: headers, best body, attachments and embedded messages, the same result from every kit.
  • S/MIME and PGP/MIME: sign, encrypt, verify, decrypt and unwrap, with Crypto.Kit.
  • iCalendar (RFC 5545, [MS-OXCICAL]) with recurrence and time zones; vCard 2.1, 3.0 and 4.0 ([MS-OXVCARD]).

How it is organised

  • uses MIMEKit; links the whole kit and registers it with the shared facades – the other kits then export .eml, iCalendar and vCard and read secure messages.
  • The MIME core: MIMEKit.Types (TMimePart, the entity tree), .Headers, .Reader, .Writer and .Codecs (Base64, quoted-printable, charsets, folding, dates).
  • Conversions: MIMEKit.FromMsgSource (any message source to MIME), .ICalendar, .VCard.
  • Security: MIMEKit.SecureReader, .SecureWriter, .SMime and .SecureMessage.
  • Clear rules: a part owns its headers and children; every value is a plain Delphi string; a message is never written half protected, and reading never raises for a cryptographic problem – the result says what was found.

Getting started

Reading an .eml: the subject, the sender and the attachments:

uses System.SysUtils, MIMEKit.Types, MIMEKit.Headers, MIMEKit.Reader;

procedure ShowParts(APart: TMimePart);
var
  Child: TMimePart;
begin
  if APart.FileName <> '' then
    Writeln('  attachment ', APart.FileName, ' (', Length(APart.Body), ' bytes)');
  for Child in APart.Parts do
    ShowParts(Child);
end;

var
  Msg: TMimePart;
begin
  Msg := TMimeReader.ParseFile('C:\Mail\offer.eml');
  try
    Writeln(Msg.Headers.GetText('Subject'), ' -- ', DateTimeToStr(Msg.Date));
    Writeln(Msg.Headers.Find('From').Addresses[0].ToString);
    ShowParts(Msg);
  finally
    Msg.Free;
  end;
end;

Building and writing a message with an attachment:

uses System.SysUtils, System.IOUtils, MIMEKit.Types, MIMEKit.Headers, MIMEKit.Writer;

var
  Msg: TMimePart;
begin
  Msg := TMimePart.Create('multipart/mixed');
  try
    Msg.Headers.AddAddresses('From', [TMimeAddress.Create('Fred Smith', 'fred@example.com')]);
    Msg.Headers.AddAddresses('To', [TMimeAddress.Create('', 'office@example.com')]);
    Msg.Headers.Add('Subject', 'Offer -- Angebot');           // encoded by the writer
    Msg.Date := Now;                                          // local time
    Msg.AddPart('text/plain').SetText('Please find the offer attached.');
    Msg.AddPart('application/pdf').SetContent(TFile.ReadAllBytes('offer.pdf'),
      'application/pdf', 'offer.pdf');
    TMimeWriter.WriteToFile(Msg, 'C:\Mail\offer.eml');
  finally
    Msg.Free;
  end;
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

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

MIME.Kit Class Reference and Developer Guide (PDF)

Pages of the MIME.Kit Class Reference and Developer Guide

MIME.Kit 1.00 – Class Reference and Developer Guide · PDF, 43 pages, English, October 2026. Introduction, requirements and rules, the units at a glance, getting started, dates and strings, MIME entities, header fields, messages of the other kits, signed and encrypted messages, iCalendar, vCard, codecs, common types and the road map.

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

MIME.Kit Class Reference and Developer Guide – PDF, 43 pages, English, free.

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


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

Intelligence Management Interface BackOffice - IMIBO - Logo

Copyright © 2026 IMIBO. Privacy Statement