- Home
- Email Parsing Software
- PHP MIME Mail Parser
PHP MIME Mail Parser
What it is
PHP MIME Mail Parser is a free PHP library that wraps the mailparse extension to read and extract information from MIME email. It can support workflows such as processing Postfix mail, reading .eml messages, creating webmail, and storing email details in a database. Input may come from a file path, raw MIME text, a PHP file resource, or a stream such as stdin. The library can return headers as raw text or as an array with character-set conversion, and extract addresses and subject lines. It retrieves text and HTML bodies, including HTML containing embedded content such as images. For attachments, it can list or save files, include or omit inline attachments, and apply a selected duplicate-filename strategy. The project recommends installing through Composer with the package name php-mime-mail-parser/php-mime-mail-parser. The current package requires PHP 8.2 or later and the mailparse extension; listed supported PHP versions are 8.2, 8.3, 8.4, and 8.5. Setup instructions cover Debian and Ubuntu, macOS, Windows, and other platforms. The library uses the MIT license and is available for Linux, macOS, Windows, and self-hosted use.
For and against
For
- Accepts file, raw-text, resource, and stream inputs.
- Retrieves text and HTML message bodies.
- Can list and save attachments.
- MIT-licensed and available across several platforms.
Against
- Requires PHP 8.2 or later.
- Requires the mailparse extension.
- No OCR extraction, webhook delivery, or API access.
The verdict
PHP MIME Mail Parser covers message headers, bodies, and attachments in PHP email workflows. Its use depends on having the required PHP version and mailparse extension.
Who it suits
This library suits PHP developers who need to parse MIME messages, extract headers or bodies, or handle attachments. It requires PHP 8.2 or later and the mailparse extension.
Plans and prices
MIT-licensed open-source library
PHP 8.2+ · requires the mailparse extension
Read 7 Oct 2026 · github.com
On the record
- Attachments
- It can list and save attachments, include or exclude inline attachments, and choose duplicate filename handling strategies.github.com · read 7 Oct 2026
- Email workflows
- The project says it can parse mail from Postfix, read .eml messages, create webmail, and store email information in a database.github.com · read 7 Oct 2026
- Headers
- The parser can return message headers as raw text or as an array with character set conversion, and can extract addresses and subject.github.com · read 7 Oct 2026
- Installation
- The README recommends installation through Composer using the package name php-mime-mail-parser/php-mime-mail-parser.github.com · read 7 Oct 2026
- Integration
- The README documents a Postfix configuration that forwards mail to a PHP script using a stream input.github.com · read 7 Oct 2026
- License
- The library is released under the MIT license.github.com · read 7 Oct 2026
- Message bodies
- It can retrieve text, HTML, and HTML with embedded content such as images.github.com · read 7 Oct 2026
- Message inputs
- Messages can be loaded from a file path, raw MIME text, a PHP file resource, or a stream such as stdin.github.com · read 7 Oct 2026
- Platform setup
- The README provides mailparse installation instructions for Debian and Ubuntu, macOS, Windows, and other platforms.github.com · read 7 Oct 2026
- Purpose
- PHP MIME Mail Parser is a PHP email parser that wraps the mailparse extension.github.com · read 7 Oct 2026
- Quality assurance
- The project says it uses GitHub Actions, Codecov, and Codacy to help ensure code quality and that known issues are reproduced, fixed, and tested.github.com · read 7 Oct 2026
- Requirements
- The current package requires PHP 8.2 or later and the mailparse extension.packagist.org · read 7 Oct 2026
- Standards
- The README says the parser handles Internet Message Format RFC 822, RFC 2822, and RFC 5322.github.com · read 7 Oct 2026
- Support
- For issue reports, the README asks users to provide the raw email that triggered the problem to help reproduce it.github.com · read 7 Oct 2026
- Supported PHP versions
- The README lists PHP 8.2, 8.3, 8.4, and 8.5 as supported versions.github.com · read 7 Oct 2026