PHP MIME Mail Parser
github.com
What it is
PHP MIME Mail Parser is a PHP library for reading MIME email, built around the mailparse extension. It can handle mail forwarded from Postfix, read.eml messages, support webmail creation, and store email information in a database. Messages may be provided by file path, raw MIME text, PHP file resource, or stream such as stdin. The parser returns headers as raw text or an array with character-set conversion, and can extract addresses and subject. For message content, it retrieves text and HTML bodies, including HTML with embedded content such as images. It can list and save attachments, include or omit inline attachments, and apply a strategy for duplicate filenames. Installation is recommended through Composer as php-mime-mail-parser/php-mime-mail-parser. It requires PHP 8.2 or later and the mailparse extension; listed supported PHP versions are 8.2, 8.3, 8.4, and 8.5. The library supports Linux, macOS, Windows, and self-hosted use, and is released under the MIT license. Pricing is free.
Spec sheet
- Purpose
- PHP MIME Mail Parser is a PHP email parser that wraps the mailparse extension.Read 7 Oct 2026 · github.com
- Support
- For issue reports, the README asks users to provide the raw email that triggered the problem to help reproduce it.Read 7 Oct 2026 · github.com
- License
- The library is released under the MIT license.Read 7 Oct 2026 · github.com
- Attachments
- It can list and save attachments, include or exclude inline attachments, and choose duplicate filename handling strategies.Read 7 Oct 2026 · github.com
- Email workflows
- The project says it can parse mail from Postfix, read .eml messages, create webmail, and store email information in a database.Read 7 Oct 2026 · github.com
- Headers
- The parser can return message headers as raw text or as an array with character set conversion, and can extract addresses and subject.Read 7 Oct 2026 · github.com
- Installation
- The README recommends installation through Composer using the package name php-mime-mail-parser/php-mime-mail-parser.Read 7 Oct 2026 · github.com
- Integration
- The README documents a Postfix configuration that forwards mail to a PHP script using a stream input.Read 7 Oct 2026 · github.com
- Message bodies
- It can retrieve text, HTML, and HTML with embedded content such as images.Read 7 Oct 2026 · github.com
- Message inputs
- Messages can be loaded from a file path, raw MIME text, a PHP file resource, or a stream such as stdin.Read 7 Oct 2026 · github.com
- Platform setup
- The README provides mailparse installation instructions for Debian and Ubuntu, macOS, Windows, and other platforms.Read 7 Oct 2026 · github.com
- 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.Read 7 Oct 2026 · github.com
- Requirements
- The current package requires PHP 8.2 or later and the mailparse extension.Read 7 Oct 2026 · packagist.org
- Standards
- The README says the parser handles Internet Message Format RFC 822, RFC 2822, and RFC 5322.Read 7 Oct 2026 · github.com
- Supported PHP versions
- The README lists PHP 8.2, 8.3, 8.4, and 8.5 as supported versions.Read 7 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Accepts files, raw MIME, PHP resources, and streams
- Extracts headers, addresses, subjects, and message bodies
- Lists and saves attachments with inline controls
- MIT licensed and free to use
Limits
- Requires PHP 8.2 or later
- Requires the mailparse extension
- No OCR extraction, webhook delivery, or API access
Who it suits
It suits PHP developers building email-processing workflows such as Postfix handling, webmail, or database storage. Users need PHP 8.2 or later and the mailparse extension.
Verdict
PHP MIME Mail Parser covers message inputs, headers, bodies, and attachments for PHP email workflows. Its prerequisites are explicit, but its use depends on PHP and mailparse.
Where Specifiction places it
- Email Parsing Software#20 of 227.5