Download the PHP package mathsgod/mht2html without Composer
On this page you can find all versions of the php package mathsgod/mht2html. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mathsgod/mht2html
More information about mathsgod/mht2html
Files in mathsgod/mht2html
Download mathsgod/mht2html
More information about mathsgod/mht2html
Files in mathsgod/mht2html
Vendor mathsgod
Package mht2html
Short Description Convert MHT/MHTML files to self-contained HTML with base64-embedded images
License MIT
Package mht2html
Short Description Convert MHT/MHTML files to self-contained HTML with base64-embedded images
License MIT
Please rate this library. Is it a good library?
Informations about the package mht2html
mht2html-php
A PHP library to convert MHT/MHTML files into self-contained HTML, with all inline images embedded as base64 data URIs.
Requirements
- PHP 8.0+
ext-mailparse(pecl install mailparse)
Installation
Usage
Convert from a file
Convert from a string
How it works
- Parses the MHT/MHTML file using
php-mime-mail-parser. - Extracts the HTML body (Quoted-Printable and charset decoding handled automatically).
- Collects all inline image attachments and maps each
Content-Locationto a base64 data URI. - Replaces every
src="..."reference in the HTML with the corresponding data URI, producing a fully self-contained HTML file with no external dependencies.
API
Converter::convertFile(string $path): string
Reads the MHT file at $path and returns self-contained HTML.
Throws \InvalidArgumentException if the file cannot be read.
Converter::convertString(string $mht): string
Accepts raw MHT/MHTML content as a string and returns self-contained HTML.
License
MIT
All versions of mht2html with dependencies
PHP Build Version
Package Version
The package mathsgod/mht2html contains the following files
Loading the files please wait ...