PHPackages                             vaibhavpandeyvpz/phemail - 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. vaibhavpandeyvpz/phemail

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

vaibhavpandeyvpz/phemail
========================

A pure PHP MIME parser for parsing raw email files (.eml) with full support for multipart messages, nested structures, and RFC 2046 compliance.

2.0.0(4mo ago)33121.7k—8.2%91MITPHPPHP ^8.2CI passing

Since Dec 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/vaibhavpandeyvpz/phemail)[ Packagist](https://packagist.org/packages/vaibhavpandeyvpz/phemail)[ Docs](https://github.com/vaibhavpandeyvpz/phemail)[ RSS](/packages/vaibhavpandeyvpz-phemail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (1)

vaibhavpandeyvpz/phemail
========================

[](#vaibhavpandeyvpzphemail)

A pure PHP MIME parser for parsing raw email files (.eml) with full support for multipart messages, nested structures, and RFC 2046 compliance.

[![Build Status](https://camo.githubusercontent.com/4f7e50f46e3153396f7cae3a435f40210e57d7c4b338f1fa7b739fddcacddb1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7661696268617670616e64657976707a2f7068656d61696c2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/vaibhavpandeyvpz/phemail/actions)[![Latest Version](https://camo.githubusercontent.com/2c95493f35e1327c279da3ba58eef237e8efbffaace8b01ad000c1413f4546c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7661696268617670616e64657976707a2f7068656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/phemail)[![Downloads](https://camo.githubusercontent.com/26ca1d40ae71801e744f5b2e59b6f05da07412d841d98452c449c73e8a42c79c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7661696268617670616e64657976707a2f7068656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/phemail)[![PHP Version](https://camo.githubusercontent.com/b746ee6ca3e979eabb6d9bd18db0d5d20847f45f150c9d8d73120929c5b0b0d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7661696268617670616e64657976707a2f7068656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/phemail)[![License](https://camo.githubusercontent.com/9d2bce231ecedfcc757330ce8fc6fcedb0a9175c98dd78c1ea619fa8222baa58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7661696268617670616e64657976707a2f7068656d61696c2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Features
--------

[](#features)

- ✅ **Pure PHP** - No external dependencies required
- ✅ **RFC 2046 Compliant** - Proper handling of multipart messages with boundaries, preamble, and epilogue
- ✅ **Nested Structures** - Supports deeply nested multipart messages and message/rfc822 types
- ✅ **Header Parsing** - Handles folded headers, continuation lines, and header attributes
- ✅ **Attachment Detection** - Automatically identifies attachments via Content-Disposition header
- ✅ **Multiple Input Types** - Accepts file paths, arrays, or iterators
- ✅ **Immutable Objects** - Thread-safe design with immutable message parts
- ✅ **PHP 8.2+** - Modern PHP with strict types and latest language features

Requirements
------------

[](#requirements)

- PHP 8.2 or higher

Installation
------------

[](#installation)

```
composer require vaibhavpandeyvpz/phemail
```

Basic Usage
-----------

[](#basic-usage)

### Parsing a Simple Email

[](#parsing-a-simple-email)

```
