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
(Classic ASP) 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.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Email") set email = Server.CreateObject("Chilkat.Email") ' Load an email object containing HTML with embedded images. success = email.LoadEml("myEmails/HtmlEmail.eml") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( email.LastErrorText) & "</pre>" Response.End End If ' Iterate over the related items. ' Print the file name and save each to a file. i = 0 numRelated = email.NumRelatedItems Do While i < numRelated Response.Write "<pre>" & Server.HTMLEncode( email.GetRelatedFilename(i)) & "</pre>" success = email.SaveRelatedItem(i,"myRelatedItemsDir") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( email.LastErrorText) & "</pre>" Response.End End If i = i + 1 Loop %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.