PHPackages                             vaibhavpandeyvpz/envelope - 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/envelope

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

vaibhavpandeyvpz/envelope
=========================

PHP library for sending RFC 2046 &amp; 822 compliant emails with a fluent API and multiple backends.

1.0.0(4mo ago)0281MITPHPPHP ^8.2CI passing

Since Dec 31Pushed 4mo agoCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (1)

Envelope
========

[](#envelope)

[![Latest Version](https://camo.githubusercontent.com/fd8cc3d3dff6a791d49a8c9bc0c44404354bfdcaa4e01fe10c75ac3390935b6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7661696268617670616e64657976707a2f656e76656c6f70652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/envelope)[![Downloads](https://camo.githubusercontent.com/2614a9649c23a3344ed6abdba1e3c9a10cea396e5574eecbdc19ecd791e0bcca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7661696268617670616e64657976707a2f656e76656c6f70652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/envelope)[![PHP Version](https://camo.githubusercontent.com/b4dd7837f247e5e81f19367790fe38af7b5d44be7bae2374d0dd74830138f995/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7661696268617670616e64657976707a2f656e76656c6f70652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vaibhavpandeyvpz/envelope)[![License](https://camo.githubusercontent.com/8ad4f8c6ea37afd658f57775a7534012861d0c12a9d8dbd7fd87272e53d35cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7661696268617670616e64657976707a2f656e76656c6f70652e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/5c8bf3cc7199b310fe7d3f5e51efd18bc3ba416687746fca8bbc674e2bf002ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7661696268617670616e64657976707a2f656e76656c6f70652f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/vaibhavpandeyvpz/envelope/actions)

A lightweight, flexible PHP library for sending RFC 2046 &amp; 822 compliant emails with a fluent API and multiple transport backends.

> **Envelope** - A wrapper for your email messages, ensuring they're properly formatted and delivered through your preferred channel.

Features
--------

[](#features)

- ✅ **RFC 822 Compliant** - Full implementation of RFC 822 email address handling
- ✅ **RFC 2046 Compliant** - Proper multipart MIME message composition
- ✅ **Fluent API** - Chainable methods for building emails intuitively
- ✅ **Multiple Transports** - Support for SMTP, Mailgun, and Resend backends
- ✅ **SMTP Support** - Direct SMTP delivery with TLS/SSL encryption
- ✅ **Mailgun Integration** - Native Mailgun API support (US &amp; EU regions)
- ✅ **Resend Integration** - Native Resend API support
- ✅ **Address Handling** - RFC 822 compliant address parsing and formatting
- ✅ **Multipart Messages** - Automatic handling of text/html alternatives and attachments
- ✅ **Attachment Support** - Easy file attachments with automatic MIME type detection
- ✅ **Header Management** - Flexible header manipulation via HeaderBag
- ✅ **Modern PHP** - Built for PHP 8.2+ with modern language features
- ✅ **Zero Dependencies** - No external dependencies required (except for testing)

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

[](#installation)

Install via Composer:

```
composer require vaibhavpandeyvpz/envelope
```

Quick Start
-----------

[](#quick-start)

```
