Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Adding TO, CC, and BCC Email Recipients
Delphi example showing how to add TO, CC, and BCC recipients to a mail message. {
The Chilkat email component provides a few ways to add TO, CC, and BCC recipients
to an email. This Delphi example code demonstrates the techniques.
}
procedure TForm1.Button11Click(Sender: TObject);
var
email: IChilkatEmail2;
begin
// A ChilkatMailMan2 ActiveX component was dropped onto the Delphi
// form, and this became the Form's member variable "ChilkatMailMan21".
ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');
ChilkatMailMan21.SmtpHost := 'smtp.comcast.net';
// A new instance of the IChilkatEmail2 object can be created by calling NewEmail
email := ChilkatMailMan21.NewEmail();
email.Subject := 'Email sent from a Delphi program!';
email.From := 'Chilkat Support <support@chilkatsoft.com>';
// Multiple To recipients can be added by calling AddTo once for each recipient.
email.AddTo('Chilkat Admin','admin@chilkatsoft.com');
email.AddTo('Matt','matt@chilkatsoft.com');
// If there is no friendly name, pass an empty string.
email.AddTo('','admin@cknotes.com');
// Callint ClearTo removes all the "TO" recipients from the email.
email.ClearTo();
// The same applies to CC and BCC:
email.ClearCC();
email.AddCc('Chilkat Admin','admin@chilkatsoft.com');
email.AddCc('Matt','matt@chilkatsoft.com');
email.AddCc('','admin@cknotes.com');
email.ClearBcc();
email.AddBcc('Chilkat Admin','admin@chilkatsoft.com');
email.AddBcc('Matt','matt@chilkatsoft.com');
email.AddBcc('','admin@cknotes.com');
// Another option is to call AddMultipleTo, AddMultipleCC, or AddMultipleBcc
// The email addresses are separated by comma delimiters.
// Each email address can have a friendly name (in quotes) and an email address
// enclosed in "< >" characters. If there is no friendly name, the "< >" characters
// are not required. For example:
email.AddMultipleTo('"Chilkat Support" <support@chilkatsoft.com>, "Admin" <admin@chilkatsoft.com>, matt@chilkatsoft.com');
email.AddMultipleCC('admin@cknotes.com, support@chilkatsoft.com, <matt@chilkatsoft.com>');
email.AddMultipleBcc('"Chilkat Support" <support@chilkatsoft.com>, <matt@chilkatsoft.com>, admin@cknotes.com');
end;
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.