PHPackages                             wp-spaghetti/wp-mail-transport - 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. wp-spaghetti/wp-mail-transport

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

wp-spaghetti/wp-mail-transport
==============================

Symfony Mailer transport for WordPress wp\_mail() - works with any Laravel + WordPress setup: Acorn (w/wo Sage), WP Starter, Corcel, or custom integrations

v0.3.0(2mo ago)09GPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Dec 30Pushed 2mo agoCompare

[ Source](https://github.com/wp-spaghetti/wp-mail-transport)[ Packagist](https://packagist.org/packages/wp-spaghetti/wp-mail-transport)[ Docs](https://github.com/wp-spaghetti/wp-mail-transport)[ Fund](https://buymeacoff.ee/frugan)[ RSS](/packages/wp-spaghetti-wp-mail-transport/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

[![PHP Version](https://camo.githubusercontent.com/7e84c72058b6dc8557309909542d83ac11613744ffb6f221225aef0385ade6d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/7e84c72058b6dc8557309909542d83ac11613744ffb6f221225aef0385ade6d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![Packagist Downloads](https://camo.githubusercontent.com/e29b7823acf6dff659673a6df9a2b30446fc227c1162b606bbb40af077678080/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/e29b7823acf6dff659673a6df9a2b30446fc227c1162b606bbb40af077678080/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![Packagist Stars](https://camo.githubusercontent.com/7a5e42f0ca73b1cc555c9ef69660b530925a8ba305cb0982bed6f3aa7624cb0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/7a5e42f0ca73b1cc555c9ef69660b530925a8ba305cb0982bed6f3aa7624cb0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![GitHub Actions Workflow Status](https://github.com/wp-spaghetti/wp-mail-transport/actions/workflows/release.yml/badge.svg)](https://github.com/wp-spaghetti/wp-mail-transport/actions/workflows/release.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/dfd70570075dccb074e08a431d2f7c9705fdea5e29b487df8b528efb780d5991/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/dfd70570075dccb074e08a431d2f7c9705fdea5e29b487df8b528efb780d5991/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![Known Vulnerabilities](https://camo.githubusercontent.com/21c1ffe3d89766cd7b33db98d6f7645d258c3d082b7e3148cf32b0bea953ac9a/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d6d61696c2d7472616e73706f72742f62616467652e737667)](https://camo.githubusercontent.com/21c1ffe3d89766cd7b33db98d6f7645d258c3d082b7e3148cf32b0bea953ac9a/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d6d61696c2d7472616e73706f72742f62616467652e737667)[![GitHub Issues](https://camo.githubusercontent.com/a7c01c10acd7d60dc56e1c486e1b619582506d1895ca58dd571a2acaf23c8a9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/a7c01c10acd7d60dc56e1c486e1b619582506d1895ca58dd571a2acaf23c8a9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![GitHub Release](https://camo.githubusercontent.com/4dd7e7def42320e1155012f84828606073ff0d8fd31e18e196ff3aec21362c65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/4dd7e7def42320e1155012f84828606073ff0d8fd31e18e196ff3aec21362c65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)[![License](https://camo.githubusercontent.com/4140e3bf3a1034b8ffeecf33b9702e7061de0c15d6fffbe65ab89ff8a803492a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)](https://camo.githubusercontent.com/4140e3bf3a1034b8ffeecf33b9702e7061de0c15d6fffbe65ab89ff8a803492a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d6d61696c2d7472616e73706f7274)

WP Mail Transport
=================

[](#wp-mail-transport)

Symfony Mailer transport that uses WordPress's `wp_mail()` function, allowing you to use Laravel's Mail facade while leveraging WordPress email plugins.

Works with any Laravel + WordPress setup: [Acorn](https://github.com/roots/acorn) (w/wo [Sage](https://github.com/roots/sage)), [WP Starter](https://wpstarter.dev/), [Corcel](https://github.com/corcel/corcel), or custom integrations.

Features
--------

[](#features)

- **Clean Laravel Syntax** - Use `Mail::to()`, `Mail::send()`, etc. anywhere in your code
- **WordPress Plugin Support** - Works seamlessly with WP Mail SMTP, SendGrid, Mailgun, and other WP email plugins
- **Zero Configuration** - Works out of the box with sensible defaults
- **Framework Agnostic** - Not tied to Acorn, works across different Laravel+WordPress stacks
- **Full Symfony Mailer API** - Support for attachments, HTML emails, CC, BCC, custom headers

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

[](#requirements)

- PHP &gt;= 8.2
- WordPress &gt;= 6.0
- Laravel Illuminate/Support ^10.0|^11.0|^12.0
- Symfony Mailer ^6.0|^7.0

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

[](#installation)

### 1. Install the package

[](#1-install-the-package)

In your Laravel + WordPress project (Sage theme, WP Starter, etc.):

```
composer require wp-spaghetti/wp-mail-transport
```

The package auto-registers via service provider discovery.

### 2. Configure mail transport

[](#2-configure-mail-transport)

Update your `config/mail.php`:

```
