(Delphi ActiveX) Load MIME Object from Email Object
Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)
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
email: TChilkatEmail;
success: Integer;
sbMime: TChilkatStringBuilder;
mime: TChilkatMime;
begin
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;
|