PHP MIME Mail Parser
github.com
- Free plan
- Windows
- macOS
- Linux
- Self-hosted
What PHP MIME Mail Parser is
PHP MIME Mail Parser is a free PHP library for extracting information from MIME email. It wraps the mailparse extension and can support workflows such as processing Postfix mail, reading .eml messages, creating webmail, or saving email details to a database. Messages can be supplied as a file path, raw MIME text, a PHP file resource, or a stream such as stdin. The parser can return headers as text or an array with character-set conversion, and extract addresses and the subject. It retrieves text and HTML bodies, including HTML with embedded content such as images. Attachment tools can list or save files, include or exclude inline attachments, and apply a selected strategy to duplicate filenames. The project recommends Composer installation under the package name 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 through 8.5. Setup instructions cover Debian and Ubuntu, macOS, Windows, and other platforms. The MIT-licensed library documents a Postfix-to-PHP stream configuration.
Who it suits
This library suits PHP developers building email-processing workflows or handling MIME messages in applications such as webmail. Users need PHP 8.2 or later and the mailparse extension.
Good to know, and what to watch
- Accepts file paths, raw MIME text, resources, and streams.
- Extracts headers, addresses, subject, and message bodies.
- Can list and save attachments, including inline files.
- MIT licensed and available for Linux, macOS, and Windows.
- Requires PHP 8.2 or later.
- Requires the mailparse extension.
- The project asks issue reporters to provide the triggering raw email.
Plans
Every plan and priceMIT-licensed open-source library
Free plan
The verdict
PHP MIME Mail Parser offers detailed message and attachment extraction for PHP workflows, with multiple input options. Confirm PHP and mailparse requirements before adding it to a project.
What the maker publishes
- Attachments
- It can list and save attachments, include or exclude inline attachments, and choose duplicate filename handling strategies. source
- Email workflows
- The project says it can parse mail from Postfix, read .eml messages, create webmail, and store email information in a database. source
- Headers
- The parser can return message headers as raw text or as an array with character set conversion, and can extract addresses and subject. source
- Installation
- The README recommends installation through Composer using the package name php-mime-mail-parser/php-mime-mail-parser. source
- Integration
- The README documents a Postfix configuration that forwards mail to a PHP script using a stream input. source
- License
- The library is released under the MIT license. source
- Message bodies
- It can retrieve text, HTML, and HTML with embedded content such as images. source
- Message inputs
- Messages can be loaded from a file path, raw MIME text, a PHP file resource, or a stream such as stdin. source
- Platform setup
- The README provides mailparse installation instructions for Debian and Ubuntu, macOS, Windows, and other platforms. source
- Purpose
- PHP MIME Mail Parser is a PHP email parser that wraps the mailparse extension. source
- 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. source
- Requirements
- The current package requires PHP 8.2 or later and the mailparse extension. source
- Standards
- The README says the parser handles Internet Message Format RFC 822, RFC 2822, and RFC 5322. source
- Support
- For issue reports, the README asks users to provide the raw email that triggered the problem to help reproduce it. source
- Supported PHP versions
- The README lists PHP 8.2, 8.3, 8.4, and 8.5 as supported versions. source
Checked against the maker's pages on 7 Oct 2026.