PHPackages                             quartzy/php-email - 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. quartzy/php-email

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

quartzy/php-email
=================

A domain model for describing emails that is indifferent towards sending methods.

0.6.0(7y ago)49.5k1Apache-2.0PHPPHP ^7.1

Since Jul 25Pushed 5y ago2 watchersCompare

[ Source](https://github.com/quartzy/php-email)[ Packagist](https://packagist.org/packages/quartzy/php-email)[ RSS](/packages/quartzy-php-email/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (9)Dependencies (1)Versions (11)Used By (1)

Php-Email
=========

[](#php-email)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b5712319386a84362783bdc82344c0fafc0f5f5d7f5b94a3d49c329942ff1731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f71756172747a792f7068702d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/quartzy/php-email)[![Total Downloads](https://camo.githubusercontent.com/b69d700bafcf369ec9985eab0f29ade24874a5a73491d59e87b6fb984338b1c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f71756172747a792f7068702d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/quartzy/php-email)[![Software License](https://camo.githubusercontent.com/f9a2da5664498a2a168a000b85719b4e5a61b6df8aae02cca978ef2580f8b1dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/6ac54f012c6f69886eebf6fbc6cb9fc586def578412179df1c66cc7eac66499e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f71756172747a792f7068702d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/quartzy/php-email)[![Coverage Status](https://camo.githubusercontent.com/146161493b7bcb4303d813e1512045c5cca6103e98380b81052dc205e4f88f05/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f71756172747a792f7068702d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/quartzy/php-email)[![Style Status](https://camo.githubusercontent.com/b614f189765e295ae7d4158fdc58a1007c07da12c2563863b0ceef6eb051c345/68747470733a2f2f7374796c6563692e696f2f7265706f732f38313532303338362f736869656c64)](https://styleci.io/repos/81520386)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/68cb7b03400b2fd87662471d7836b5abbd4db200c49250dfc2e5bdd1274cf1b7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f71756172747a792f7068702d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/quartzy/php-email)

This is a domain-driven library for defining emails in PHP.

Php Email brings three major benefits over other similar libraries:

1. Focusing on new versions of PHP. By using the newer versions of PHP (5.6+) we can leverage great features such as splat parameters and better type hinting.
2. Focusing on only the email, instead of transmission. In a domain-driven world, emails can and should exist separately from the delivery mechanism. By separating these concerns, this library decreases the size and complexity of the domain, while giving developers greater flexibility in how they use the library.
3. Flexible content definitions. Emails have gone from a simple text string to highly stylized HTML to now just being templates stored in third-party services. Existing libraries do not provide enough flexibility to support everything developers need. Php Email attempts to correct this by creating guidelines for possible email content, but also allowing developers to define what they need.

Install
-------

[](#install)

### With Composer

[](#with-composer)

```
composer require quartzy/php-email
```

Usage
-----

[](#usage)

Building an email with HTML and text content would look like:

```
