Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
Access Embedded HTML images and style sheets
Demonstrates how to examine an HTML email's embedded objects (related items). Shows how to get the related item filename, content-ID, and data. procedure TForm1.Button26Click(Sender: TObject); var email: CHILKATMAILLib2_TLB.IChilkatEmail2; numRelatedItems: Integer; i: Integer; filename: String; contentId: String; relatedItemData: OleVariant; begin ChilkatMailMan21.UnlockComponent('Anything for 30-day trial'); ChilkatMailMan21.SmtpHost := 'smtp.comcast.net'; // Load an HTML email... email := ChilkatMailMan21.NewEmail(); email.LoadEml('htmlEmail.eml'); // The embedded HTML images and/or style sheets are "related" items. numRelatedItems := email.NumRelatedItems; for i := 0 to numRelatedItems-1 do begin // The filename and content ID (cid) can be retrieved with these method calls: filename := email.GetRelatedFilename(i); contentId := email.GetRelatedContentID(i); // An individual related item can be saved to a file in a directory. // This call saves the related item to the 'relatedItems' subdirectory email.SaveRelatedItem(i,'relatedItems'); // The binary data of a related item can be retrieved by calling GetRelatedData. // (You'll have to research how to use an OleVariant. That is not explained // in this example.) relatedItemData := email.GetRelatedData(i); end; end;
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.