Programming Examples

ChilkatHOMEASPVisual BasicVB.NETC#CC++MFCDelphiFoxProJavaPerlPythonRubySQL ServerVBScript

PHP ActiveX Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
DKIM / DomainKey
Diffie-Hellman
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3


 

 

 

 

 

 

 

 

Unpack HTML Email to Files

Unpacks an HTML email into an HTML file and related files (images and style sheets). The links within the HTML are updated to point to the files unpacked and saved to disk.

Download Chilkat Email ActiveX

Download 32-bit Chilkat IMAP ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

<?php


$email = new COM("Chilkat.Email2");

$success = $email->LoadEml('bonaire.eml');
if ($success != true) {
    print $email->lastErrorText() . "\n";
    exit;
}

//  Is this an HTML email?
if ($email->HasHtmlBody() == true) {

    //  Unpack the HTML to files.  The image and css URLs
    //  in the HTML are modified to point to the files extracted to disk.
    $unpackDir = 'c:/temp';
    $partsSubdir = 'images';
    $htmlFilename = 'thisEmail.html';
    $success = $email->UnpackHtml($unpackDir,$htmlFilename,$partsSubdir);
    if ($success != true) {
        print $email->lastErrorText() . "\n";
    }

    //  If the UnpackHtml method was successful, the
    //  HTML is written to c:/temp/thisEmail.html and
    //  the image files are located in c:/temp/images

}


?>

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.