Sample code for 30+ languages & platforms
Delphi ActiveX Requires Chilkat v11.0.0+

Read individual messages in a MIME digest

See more Email Object Examples

Use a saved multipart/digest message. NumDigests and GetDigestEmail expose each enclosed message as an Email object. Inspect its own sender and subject instead of assuming all entries share the wrapper’s metadata.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
var
success: Integer;
email: TChilkatEmail;
item: TChilkatEmail;
i: Integer;

begin
success := 0;

//  Assumes Chilkat is unlocked. See Global Unlock Sample.

email := TChilkatEmail.Create(Self);
success := email.LoadEml('digest.eml');
if (success <> 1) then
  begin
    Memo1.Lines.Add(email.LastErrorText);
    Exit;
  end;
Memo1.Lines.Add('Digest entries: ' + IntToStr(email.NumDigests));
item := TChilkatEmail.Create(Self);
i := 0;
while (i < email.NumDigests) do
  begin
    success := email.GetDigestEmail(i,item.ControlInterface);
    if (success <> 1) then
      begin
        Memo1.Lines.Add(email.LastErrorText);
        Exit;
      end;
    Memo1.Lines.Add(IntToStr(i) + '  ' + item.FromAddress + '  ' + item.Subject);
    i := i + 1;
  end;