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

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

phpnomad/email
==============

1.0.0(1y ago)03.1k[1 PRs](https://github.com/phpnomad/email/pulls)3MITPHPCI passing

Since Apr 19Pushed 3w ago2 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (7)Used By (3)

phpnomad/email
==============

[](#phpnomademail)

[![Latest Version](https://camo.githubusercontent.com/8029ba134e4e44cc401684cde0555bc9a22040a1726a7b689aea97bed2de8874/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f656d61696c2e737667)](https://packagist.org/packages/phpnomad/email)[![Total Downloads](https://camo.githubusercontent.com/d174f19d04d44172e99e081eee9d46fb2f7264db4717bfdf876612292c46aa95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f656d61696c2e737667)](https://packagist.org/packages/phpnomad/email)[![PHP Version](https://camo.githubusercontent.com/da67d4f7c19be989ba50183f7c162b760bcd59d795b73f2ce06f882cb5a3f8fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f656d61696c2e737667)](https://packagist.org/packages/phpnomad/email)[![License](https://camo.githubusercontent.com/c0f7c0292703987732f10b7ac38b4e0ffd27357a3da8f0ef728bf03178195d38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f656d61696c2e737667)](https://packagist.org/packages/phpnomad/email)

`phpnomad/email` defines the contract PHPNomad applications use to send transactional mail. It contains a single strategy interface, `EmailStrategy`, and a failure exception. Concrete sending lives in a separate integration package, so your application code depends on the contract rather than on a specific mailer. Swap the strategy in your bootstrapper and the rest of your code stays the same. The built-in implementation is [`phpnomad/php-mail-integration`](https://packagist.org/packages/phpnomad/php-mail-integration), which sends through PHP's `mail()` function. Anything else (SMTP, a third-party API, a queued background worker) drops in by writing another class that implements the interface.

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

[](#installation)

```
composer require phpnomad/email
```

You will also need a strategy implementation. Install `phpnomad/php-mail-integration` for the default, or provide your own class that implements `EmailStrategy`.

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

[](#quick-start)

Inject `EmailStrategy` wherever you send mail, then call `send()` and handle `EmailSendFailedException`.

```
