PHPackages                             phpnomad/php-mail-integration - 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/php-mail-integration

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

phpnomad/php-mail-integration
=============================

1.0.0(1y ago)013[2 PRs](https://github.com/phpnomad/php-mail-integration/pulls)1MITPHPCI passing

Since Dec 18Pushed 3w ago2 watchersCompare

[ Source](https://github.com/phpnomad/php-mail-integration)[ Packagist](https://packagist.org/packages/phpnomad/php-mail-integration)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-php-mail-integration/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (5)Used By (1)

phpnomad/php-mail-integration
=============================

[](#phpnomadphp-mail-integration)

[![Latest Version](https://camo.githubusercontent.com/09135e9fd755ce63e27130057bd957b08d5392e137fe5da909318ac0035f93d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f7068702d6d61696c2d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/php-mail-integration)[![Total Downloads](https://camo.githubusercontent.com/16dab1919a3f861d9eb4f7ef728de7cd3a76b17962f5b134d55f13ac0738e0eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f7068702d6d61696c2d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/php-mail-integration)[![PHP Version](https://camo.githubusercontent.com/65c306f66e90badf64478cb046f544c2ae411305ea66f9d1db888aa300503306/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f7068702d6d61696c2d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/php-mail-integration)[![License](https://camo.githubusercontent.com/254497337bd9b4ef908845ad49f1e8d491e82223969ef790c86b356d70396272/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f7068702d6d61696c2d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/php-mail-integration)

Integrates PHP's built-in `mail()` function with `phpnomad/email`'s `EmailStrategy`. Reach for this when the host already has a working mail transport configured at the PHP level and your application just needs something to drop into the `EmailStrategy` slot. There are no external library dependencies, no queuing, and no template rendering. The package is a thin adapter between the `EmailStrategy` contract and the `mail()` call.

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

[](#installation)

```
composer require phpnomad/php-mail-integration
```

What This Provides
------------------

[](#what-this-provides)

- `PHPMailStrategy` implements `PHPNomad\Email\Interfaces\EmailStrategy`. It joins recipients into a comma-separated list, flattens headers into `Key: Value` lines, and hands the message to PHP's `mail()`. A `false` return from `mail()` raises `EmailSendFailedException`.

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

[](#requirements)

- `phpnomad/email ^1.0`
- A working PHP `mail()` configuration on the host (sendmail binary, SMTP relay, or the equivalent). The `mail()` function returns `false` when the transport is missing or misconfigured, and this strategy converts that into an `EmailSendFailedException`.

Usage
-----

[](#usage)

Bind `PHPMailStrategy` to `EmailStrategy` inside an initializer so the container hands it to anything that depends on email sending.

```
