![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) Extract Files from MIMEExtract files from a MIME message. Note: This example requires Chilkat v11.0.0 or greater.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Mime, StringTable; ... procedure TForm1.Button1Click(Sender: TObject); var success: Boolean; mime: HCkMime; st: HCkStringTable; n: Integer; i: Integer; begin success := False; // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. mime := CkMime_Create(); // Load a MIME document from a file: // (.mht and .eml files contain MIME). success := CkMime_LoadMimeFile(mime,'mst.mht'); if (success = False) then begin Memo1.Lines.Add(CkMime__lastErrorText(mime)); Exit; end; st := CkStringTable_Create(); success := CkMime_PartsToFiles(mime,'/temp/mimeParts',st); if (success = False) then begin Memo1.Lines.Add(CkMime__lastErrorText(mime)); Exit; end; n := CkStringTable_getCount(st); // Display the paths of the files created: i := 0; while i < n do begin Memo1.Lines.Add(CkStringTable__stringAt(st,i)); i := i + 1; end; CkMime_Dispose(mime); CkStringTable_Dispose(st); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.