Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) Save HTML Email Embedded ImagesSaves HTML embedded items to files in a subdirectory. Images, style sheets, and anything else embedded within HTML, are not considered to be attachments. Instead, these items are "related item". The Chilkat email object provides a set of methods/properties for accessing the related items within an email.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Email; ... procedure TForm1.Button1Click(Sender: TObject); var email: HCkEmail; success: Boolean; i: Integer; numRelated: Integer; begin email := CkEmail_Create(); // Load an email object containing HTML with embedded images. success := CkEmail_LoadEml(email,'myEmails/HtmlEmail.eml'); if (success <> True) then begin Memo1.Lines.Add(CkEmail__lastErrorText(email)); Exit; end; // Iterate over the related items. // Print the file name and save each to a file. i := 0; numRelated := CkEmail_getNumRelatedItems(email); while i < numRelated do begin Memo1.Lines.Add(CkEmail__getRelatedFilename(email,i)); success := CkEmail_SaveRelatedItem(email,i,'myRelatedItemsDir'); if (success <> True) then begin Memo1.Lines.Add(CkEmail__lastErrorText(email)); Exit; end; i := i + 1; end; CkEmail_Dispose(email); end; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.