Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Unpack HTML Email to Files
This example demonstrates how to use Chilkat Email + Chilkat MHT to unpack an HTML email to HTML files where the image and style sheet URLs within the HTML are updated to reference the image and style sheet files that are created. ' Unpack HTML email to an HTML file. All embedded images
' and style sheets are written to files in a sub-directory. The links
' within the HTML are updated to reference the extracted files.
' First, unlock the components that are needed. This example
' requires a license to both the email and MHT components.
Dim mailman As New ChilkatMailMan2
mailman.UnlockComponent "Anything for 30-day trial"
Dim mht As New ChilkatMHT
mht.UnlockComponent "Anything for 30-day trial"
' Load an HTML email from a .eml file.
Dim email As New ChilkatEmail2
email.LoadEml "htmlEmail.eml"
' Unpack the email to "unpackDir/myEmail.html". Images and style sheets
' are written to the "unpackDir/images" subdirectory. All directories
' are automatically created if not already existing.
mht.UnpackMhtStr email.GetMime(), "unpackDir", "myEmail.html", "images"
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.