Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Load MHT as Email and Send
Loads a web page saved as a .mht web archive as an email and sends it. // Web pages saved as .mht files are nothing other than MIME text. If you // change the file extension to .eml, you can load it into Outlook Express // and view it as an HTML email. Using the Chilkat email component, you can // load the MHT into an email object, add a subject, From, and To -- and then send. procedure TForm1.Button19Click(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'; // Load a .MHT file, add a subject, From, and TO, and send. email := ChilkatMailMan21.NewEmail(); email.LoadEml('invoice.mht'); email.Subject := 'Email sent from a Delphi program!'; email.From := 'Chilkat Support <support@chilkatsoft.com>'; email.AddTo('TagTooga','admin@tagtooga.com'); 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-2007 Chilkat Software, Inc. All Rights Reserved.