Sample code for 30+ languages & platforms
Delphi ActiveX

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
email: TChilkatEmail;
sbMime: TChilkatStringBuilder;
mime: TChilkatMime;

begin
success := 0;

email := TChilkatEmail.Create(Self);
success := email.LoadEml('qa_data/eml/sample.eml');

// Write the full MIME of the email to a StringBuilder.
sbMime := TChilkatStringBuilder.Create(Self);
email.GetMimeSb(sbMime.ControlInterface);

// Load the MIME object from the StringBuilder
mime := TChilkatMime.Create(Self);
success := mime.LoadMimeSb(sbMime.ControlInterface);

Memo1.Lines.Add(mime.GetMime());
end;