Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Send one message with two blind copies
See more Email Object Examples
Set NoBccHeader before adding blind-copy addresses. SendEmail then includes those recipients in the SMTP envelope and omits their addresses from the message headers sent to the relay. Replace the example account and addresses before running this SMTP submission.
Chilkat Delphi DLL Downloads
var
success: Boolean;
email: HCkEmail;
mail: HCkMailMan;
begin
success := False;
// Assumes Chilkat is unlocked. See Global Unlock Sample.
email := CkEmail_Create();
CkEmail_putFrom(email,'Workshop team <events@example.com>');
success := CkEmail_AddTo(email,'Alex Rivera','alex@example.net');
if (success <> True) then
begin
Memo1.Lines.Add(CkEmail__lastErrorText(email));
Exit;
end;
CkEmail_putSubject(email,'Workshop registration');
CkEmail_putBody(email,'Registration is confirmed.');
// Set this before AddBcc so the submitted MIME omits the Bcc header.
CkEmail_putUncommonOptions(email,'NoBccHeader');
success := CkEmail_AddBcc(email,'Archive','archive@example.com');
if (success <> True) then
begin
Memo1.Lines.Add(CkEmail__lastErrorText(email));
Exit;
end;
success := CkEmail_AddBcc(email,'Event records','records@example.com');
if (success <> True) then
begin
Memo1.Lines.Add(CkEmail__lastErrorText(email));
Exit;
end;
mail := CkMailMan_Create();
CkMailMan_putSmtpHost(mail,'smtp.example.com');
CkMailMan_putSmtpPort(mail,465);
CkMailMan_putSmtpSsl(mail,True);
CkMailMan_putRequireSslCertVerify(mail,True);
CkMailMan_putSmtpUsername(mail,'SMTP_USERNAME');
CkMailMan_putSmtpPassword(mail,'SMTP_PASSWORD');
success := CkMailMan_SendEmail(mail,email);
if (success <> True) then
begin
Memo1.Lines.Add(CkMailMan__lastErrorText(mail));
Exit;
end;
Memo1.Lines.Add('SMTP relay accepted the submission.');
success := CkMailMan_CloseSmtpConnection(mail);
if (success <> True) then
begin
Memo1.Lines.Add('The SMTP session did not close cleanly.');
end;
CkEmail_Dispose(email);
CkMailMan_Dispose(mail);