Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Send Email with Attachments
Delphi example code to send email with attachments using the Chilkat Mail ActiveX. // Send an email with file attachments. procedure TForm1.Button14Click(Sender: TObject); var email: IChilkatEmail2; ok: Integer; 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'; email := ChilkatMailMan21.NewEmail(); email.Subject := 'Email with attachments sent from a Delphi program!'; email.From := 'Chilkat Support <support@chilkatsoft.com>'; email.AddTo('Chilkat Admin','admin@chilkatsoft.com'); email.Body := 'This email was sent from a Delphi program...'; // Add a few file attachments. email.AddFileAttachment('dude.gif'); email.AddFileAttachment('fw9.pdf'); // Add an attachment directly from an in-memory string. email.AddStringAttachment('test.xml','<test><companyName>Chilkat Software</companyName></test>'); ok := ChilkatMailMan21.SendEmail(email); if (ok = 0) then ChilkatMailMan21.SaveLastError('errorLog.xml'); end;
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.