Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
| Add Code to Send Mail In the Delphi IDE, add the following code for the "Send Email" button:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, CHILKATMAILLib2_TLB;
type
TForm1 = class(TForm)
ChilkatMailMan21: TChilkatMailMan2;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
email: IChilkatEmail2;
ok: Integer;
begin
ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');
ChilkatMailMan21.SmtpHost := 'smtp.comcast.net';
email := ChilkatMailMan21.NewEmail();
email.Subject := 'This is a test';
email.From := 'Chilkat Support <support@chilkatsoft.com>';
email.AddTo('John Doe','jdoe@someplace.com');
email.Body := 'This is the body...';
ok := ChilkatMailMan21.SendEmail(email);
if (ok = 0) then
ChilkatMailMan21.SaveLastError('errorLog.xml');
end;
end.
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.