Delphi ActiveX Requires Chilkat v11.0.0+
Delphi ActiveX
Inspect blind-copy recipients and prepare a shareable copy
See more Email Object Examples
Keep the addressed Email object for SMTP submission. When exporting a copy to share, clear its Bcc collection before saving. Treat intermediate MIME buffers as private because a renderer can preserve blind-copy details.
Chilkat Delphi ActiveX Downloads
var
success: Integer;
email: TChilkatEmail;
i: Integer;
rendered: TChilkatBinData;
copy: TChilkatEmail;
begin
success := 0;
// Assumes Chilkat is unlocked. See Global Unlock Sample.
email := TChilkatEmail.Create(Self);
email.From := 'Workshop team <events@example.com>';
success := email.AddTo('Alex Rivera','alex@example.net');
if (success <> 1) then
begin
Memo1.Lines.Add(email.LastErrorText);
Exit;
end;
email.Subject := 'Workshop registration';
email.Body := 'Your workshop confirmation.';
success := email.AddBcc('Archive','archive@example.com');
if (success <> 1) then
begin
Memo1.Lines.Add(email.LastErrorText);
Exit;
end;
i := 0;
while (i < email.NumBcc) do
begin
Memo1.Lines.Add('Envelope blind copy: ' + email.GetBccAddr(i));
i := i + 1;
end;
// Keep the original delivery list intact. Remove blind copies from the export.
rendered := TChilkatBinData.Create(Self);
success := email.GetMimeBd(rendered.ControlInterface);
if (success <> 1) then
begin
Memo1.Lines.Add(email.LastErrorText);
Exit;
end;
copy := TChilkatEmail.Create(Self);
success := copy.SetFromMimeBd(rendered.ControlInterface);
if (success <> 1) then
begin
Memo1.Lines.Add(copy.LastErrorText);
Exit;
end;
copy.ClearBcc();
success := copy.SaveEml('shareable.eml');
if (success <> 1) then
begin
Memo1.Lines.Add(copy.LastErrorText);
Exit;
end;
Memo1.Lines.Add('Bcc entries in shareable copy: ' + IntToStr(copy.NumBcc));