PHPackages                             erseco/mime-mail-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. erseco/mime-mail-parser

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

erseco/mime-mail-parser
=======================

Parse emails without the mailparse extension

v1.0.5(2mo ago)0942↓100%[1 issues](https://github.com/erseco/mime-mail-parser/issues)MITPHPPHP ^8.0CI passing

Since Nov 18Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/erseco/mime-mail-parser)[ Packagist](https://packagist.org/packages/erseco/mime-mail-parser)[ RSS](/packages/erseco-mime-mail-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (11)Used By (0)

Mime Mail Parser for PHP
Simple, fast, no extensions required, based on \[opcodesio/mail-parser\]()
=============================================================================================================================================

[](#mime-mail-parser-for-phpsimple-fast-no-extensions-required-based-on-opcodesiomail-parserhttpsgithubcomopcodesiomail-parser)

 [Features](#features) | [Installation](#installation) | [Credits](#credits)

[![Packagist](https://camo.githubusercontent.com/16d1ef0e7328b98b8df2e2ad308327788385ae36a5cb0c1a9a1a2f706277951d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65727365636f2f6d696d652d6d61696c2d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erseco/mime-mail-parser)[![Packagist](https://camo.githubusercontent.com/be1d8523d49dbf37ced6371ff132bf1a9a3816aa14b21ac47091bdcff3b523e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f65727365636f2f6d696d652d6d61696c2d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erseco/mime-mail-parser)[![PHP from Packagist](https://camo.githubusercontent.com/981741f4cbef0017f55f8b22f7e19b2c2da01b75e42f8445c889f3287608af55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f65727365636f2f6d696d652d6d61696c2d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erseco/mime-mail-parser)

Features
--------

[](#features)

**Mime Mail Parser** has a very simple API to parse emails and their MIME contents. Unlike many other parsers out there, this package does not require the [mailparse](https://www.php.net/manual/en/book.mailparse.php) PHP extension.

Has not been fully tested against RFC 5322.

Get Started
-----------

[](#get-started)

### Requirements

[](#requirements)

- **PHP 8.0+**

### Installation

[](#installation)

To install the package via composer, Run:

```
composer require erseco/mime-mail-parser
```

### Usage

[](#usage)

```
use Erseco\Message;

// Parse a message from a string
$rawEmail = file_get_contents('/path/to/email.eml');
$message = Message::fromString($rawEmail);

// Or parse from a file directly
$message = Message::fromFile('/path/to/email.eml');

$message->getHeaders();                 // get all headers as array
$message->getHeader('Content-Type');    // get specific header
$message->getContentType();             // 'multipart/mixed; boundary="----=_Part_1_1234567890"'
$message->getFrom();                    // 'Service '
$message->getTo();                      // 'John Doe '
$message->getSubject();                 // 'Subject line'
$message->getDate();                    // DateTime object when the email was sent

$message->getParts();       // Returns array of MessagePart objects
$message->getHtmlPart();    // Returns MessagePart with HTML content
$message->getTextPart();    // Returns MessagePart with Text content
$message->getAttachments(); // Returns array of attachment MessageParts

// Working with message parts
$parts = $message->getParts();
$firstPart = $parts[0];

$firstPart->getHeaders();                 // array of all headers for this part
$firstPart->getHeader('Content-Type');    // get specific header
$firstPart->getContentType();             // 'text/html; charset="utf-8"'
$firstPart->getContent();                 // '....'
$firstPart->isHtml();                     // true if it's an HTML part
$firstPart->isText();                     // true if it's a text part
$firstPart->isAttachment();               // true if it's an attachment
$firstPart->getFilename();                // name of the file if attachment
$firstPart->getSize();                    // size of content in bytes
```

Credits
-------

[](#credits)

- [opcodesio/mail-parser](https://github.com/opcodesio/mail-parser)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance93

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~94 days

Recently: every ~117 days

Total

6

Last Release

67d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5ea8bfbc980d75f631518d4ad799df45e9a576d7b19eed0ae9c613c65104251?d=identicon)[erseco](/maintainers/erseco)

---

Top Contributors

[![erseco](https://avatars.githubusercontent.com/u/1876752?v=4)](https://github.com/erseco "erseco (46 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (5 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

---

Tags

phpmailmimeemailemail parsererseco

###  Code Quality

TestsPest

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/erseco-mime-mail-parser/health.svg)

```
[![Health](https://phpackages.com/badges/erseco-mime-mail-parser/health.svg)](https://phpackages.com/packages/erseco-mime-mail-parser)
```

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[php-mime-mail-parser/php-mime-mail-parser

A fully tested email parser for PHP 8.0+ (mailparse extension wrapper).

9979.6M27](/packages/php-mime-mail-parser-php-mime-mail-parser)[opcodesio/mail-parser

Parse emails without the mailparse extension

216.8M8](/packages/opcodesio-mail-parser)[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

56770.5k](/packages/railsware-mailtrap-php)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3516.6k](/packages/benhall14-php-imap-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
