PHP MIME Mail Parser
PHP MIME Mail Parser is a free PHP library for extracting information from MIME email, built around the mailparse extension.
What PHP MIME Mail Parser is
PHP MIME Mail Parser is a free PHP library for extracting information from MIME email, built around the mailparse extension. It can read messages from a file path, raw MIME text, a PHP file resource, or a stream such as stdin. The parser can return headers as raw text or as an array with character-set conversion, and extract addresses and a subject. It retrieves text and HTML bodies, including HTML containing embedded content such as images. Attachment functions can list and save files, include or exclude inline attachments, and apply a chosen strategy to duplicate filenames. These capabilities can support workflows such as parsing Postfix mail, reading .eml messages, creating webmail, or storing email information in a database. The project recommends installing through Composer. The current package requires PHP 8.2 or later and the mailparse extension; listed supported versions are PHP 8.2, 8.3, 8.4, and 8.5. Setup instructions cover several platforms, and the README documents forwarding Postfix mail to a PHP script. The library is MIT-licensed and available for Linux, macOS, Windows, and self-hosted use.
Good
- Accepts files, raw MIME text, PHP resources, and streams.
- Retrieves text and HTML message bodies.
- Can list and save attachments.
- MIT-licensed and free.
Watch out
- Requires PHP 8.2 or later.
- Requires the mailparse extension.
- Does not provide OCR extraction or webhook delivery.
Who it suits
This library suits PHP developers who need to parse email messages or handle message bodies and attachments in their own applications. It requires PHP 8.2 or later and the mailparse extension.
Verdict
PHP MIME Mail Parser provides email parsing and attachment handling for PHP projects, with several message input options. Check the PHP and mailparse requirements before using it.
Plans and prices
From PHP MIME Mail Parser's own pricing page, checked 7 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| MIT-licensed open-source library | Free | PHP 8.2+ · requires the mailparse extension · Not applicable |
The facts
Each one read from PHP MIME Mail Parser's own pages, with the date it was checked.
What it does
- Attachments
- It can list and save attachments, include or exclude inline attachments, and choose duplicate filename handling strategies.checked 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.checked 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.checked 7 Oct 2026
- Installation
- The README recommends installation through Composer using the package name php-mime-mail-parser/php-mime-mail-parser.checked 7 Oct 2026
- Integration
- The README documents a Postfix configuration that forwards mail to a PHP script using a stream input.checked 7 Oct 2026
- License
- The library is released under the MIT license.checked 7 Oct 2026
- Message bodies
- It can retrieve text, HTML, and HTML with embedded content such as images.checked 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.checked 7 Oct 2026
- Purpose
- PHP MIME Mail Parser is a PHP email parser that wraps the mailparse extension.checked 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.checked 7 Oct 2026
- Requirements
- The current package requires PHP 8.2 or later and the mailparse extension.checked 7 Oct 2026
- Standards
- The README says the parser handles Internet Message Format RFC 822, RFC 2822, and RFC 5322.checked 7 Oct 2026
- Support
- For issue reports, the README asks users to provide the raw email that triggered the problem to help reproduce it.checked 7 Oct 2026
- Supported PHP versions
- The README lists PHP 8.2, 8.3, 8.4, and 8.5 as supported versions.checked 7 Oct 2026
Where it runs
- Platform setup
- The README provides mailparse installation instructions for Debian and Ubuntu, macOS, Windows, and other platforms.checked 7 Oct 2026
The full review of PHP MIME Mail Parser
Overview
PHP MIME Mail Parser is a PHP library for turning MIME email into headers, message bodies, and attachments. It is best suited to developers building mail workflows in PHP; its main trade-off is the need to manage PHP and the mailparse extension in your own environment.
For projects that need to process messages rather than buy a hosted inbox-to-data service, it offers useful input flexibility and attachment controls at no license cost. It is less suitable if you need OCR, webhook delivery, or a hosted API.
Key features
Messages can be loaded from a file path, raw MIME text, a PHP file resource, or a stream such as stdin. That makes the library adaptable to saved-message processing as well as stream-based intake. The documented Postfix setup can forward mail to a PHP script, which is a practical fit for server-side workflows; the project also identifies reading .eml files, building webmail, and storing email information in a database as use cases.
For message inspection, it can return headers as raw text or as an array with character-set conversion, and extract addresses and subject. It retrieves text and HTML bodies, including HTML with embedded content such as images. Attachment support covers listing and saving files, including or excluding inline attachments, and selecting how duplicate filenames are handled. These controls help when applications need to distinguish ordinary files from embedded content or avoid collisions during extraction.
The parser handles Internet Message Format RFC 822, RFC 2822, and RFC 5322. Composer installation uses php-mime-mail-parser/php-mime-mail-parser. The project says it uses GitHub Actions, Codecov, and Codacy for quality assurance, and that known issues are reproduced, fixed, and tested. For issue reports, maintainers ask for the raw email that caused the problem, so users should be prepared to share a representative message when seeking help.
Pricing
The MIT-licensed open-source library costs free, with billing not applicable. There is no paid tier or free trial. That makes it a straightforward choice for developers who can integrate and operate the parser themselves; there are no paid-plan quotas or seat limits to weigh. The cost advantage does not remove the engineering work of configuring the runtime and building any surrounding delivery or extraction workflow.
The library provides attachment parsing, but not OCR extraction, webhook delivery, API access, or custom extraction fields. Choose it for programmatic MIME parsing inside a PHP application, not as a turnkey service that accepts email and sends structured results elsewhere.
Platforms
It is available for Linux, macOS, Windows, and self-hosted environments. The current package requires PHP 8.2 or later and the mailparse extension; supported PHP versions are 8.2, 8.3, 8.4, and 8.5. Installation guidance covers Debian and Ubuntu, macOS, Windows, and other platforms. Those requirements are manageable for a maintained PHP stack, but may rule it out where upgrading PHP or enabling mailparse is not practical.
Who it's for
PHP developers who need to parse incoming or archived MIME messages, inspect headers and bodies, and save attachments will get the most from this library. It suits teams able to own deployment and connect parsing to their own storage or application logic. Readers who want hosted integrations, webhook delivery, or OCR should consider a service built around those needs instead.
Pros and cons
Pros
- Flexible message input: file paths, raw MIME, PHP resources, and streams can support different ingestion patterns.
- Useful attachment controls: inline inclusion and duplicate-filename handling can be configured alongside listing and saving.
- No license charge: the MIT-licensed library is free to use, without a trial period or paid tier.
- Documented platform setup: guidance for common operating systems and Postfix can help developers fit it into an existing PHP mail workflow.
Cons
- Runtime prerequisites: PHP 8.2 or later and mailparse are required, adding setup work and limiting use on older PHP deployments.
- No hosted delivery layer: it does not provide webhook delivery or API access, so applications must supply their own integration path.
- No OCR or custom extraction fields: it parses MIME content but is not a document-recognition or configurable data-extraction service.
Alternatives
Email Parsing Software is the broader category directory for comparing other options.
- CloudMailin is a hosted API and web option with a free plan of 10,000 emails per month and a 512KB per-message limit; choose it if managed email intake matters more than parsing within your PHP code.
- MailFrame offers API and web access, with a free tier of 100 parse operations per month, one active schema, and webhook delivery; it may suit a workflow centered on schema-based parsing and webhooks.
- noima is an API and web alternative with a free allowance of 10 documents once and 30 days of retention; consider it when document processing and retention terms are a better fit than a self-hosted PHP library.
- Parserr provides API and web access, with a free plan covering 15 emails per month, 10 documents per month, and one inbox; choose it if inbox-based parsing rules and integrations are the priority.
- Parsio Receipt OCR has API and web access and a free allowance of 30 credits per month, 30-day retention, and one user; it is the alternative to consider for receipt OCR rather than general PHP MIME parsing.
- Parsli offers API and web access, with 10 free pages on signup, unlimited parsers, and API access plus integrations; consider it if those parser and integration provisions suit your workflow.
- DigiParser is an API and web alternative with a free plan described as covering 100 documents; it may fit readers looking for document parsing rather than a library embedded in PHP.
- MailParse offers API and web access; its free plan includes 100 emails per month, webhook delivery, REST polling, and one inbound address, making it worth considering for hosted inbound-email processing.
Verdict
Choose PHP MIME Mail Parser if you are building a PHP application that needs direct access to MIME headers, bodies, and attachments without a software license fee. Its strongest case is the combination of flexible inputs and attachment handling in a library you can run in your own stack. Look elsewhere if you need hosted intake, webhook or API delivery, OCR, or cannot meet the PHP 8.2+ and mailparse requirements.
Getting started
- Install PHP 8.2 or later and the mailparse extension.
- Install php-mime-mail-parser/php-mime-mail-parser through Composer.
- Load a message from a file path, raw MIME text, a PHP resource, or a stream.
- Configure Postfix to forward mail to a PHP script if using that workflow.
Limits worth knowing
The library requires PHP 8.2 or later and the mailparse extension. It does not offer OCR extraction, webhook delivery, or API access.
Questions
How much does PHP MIME Mail Parser cost?
It is free, with a listed price of no cost.
What does it require?
It requires PHP 8.2 or later and the mailparse extension. Supported PHP versions listed are 8.2 through 8.5.
Which platforms does it support?
It is listed for Linux, macOS, Windows, and self-hosted use.
How do I install it?
The project recommends installing the package php-mime-mail-parser/php-mime-mail-parser through Composer.
Is it open source?
It is released under the MIT license.
What can it do with attachments?
It can list and save attachments, include or exclude inline attachments, and handle duplicate filenames using different strategies.
Alternatives to PHP MIME Mail Parser
- 1

DigiParser
Free planAndroidiOSWebAPI7.9Free plan - 2

Parseur
Free planWebAPI7.6From $49 a month - 3

MailFrame
Free planWebAPI7.3From $19 a month - 4

Email Parser
WebAPIWindows7.0From $145 a year - 5

CloudMailin
Free planWebAPI6.8From $25 a month - 6

Parsio Receipt OCR
Free planWebAPI6.8From $24 a month
