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

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

jeffreyvanrossum/wp-mail
========================

Fluent API for sending emails.

0.3.0(5mo ago)362MITPHPPHP ^8.0|^8.1|^8.2

Since Jul 17Pushed 5mo agoCompare

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

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

[![vanrossum.dev Logo](https://raw.githubusercontent.com/jeffreyvr/vanrossum.dev-art/main/logo.svg)](https://vanrossum.dev)

[![Total Downloads](https://camo.githubusercontent.com/ec1cdb1a89e91f7f131ce651f4a02aa07ae5334f8d11d27fdb5d327a01c77b5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a65666672657976616e726f7373756d2f77702d6d61696c)](https://packagist.org/packages/jeffreyvanrossum/wp-mail)[![Latest Stable Version](https://camo.githubusercontent.com/480bf57cec4c7cc9c04dee4f6cdf3e1bdcc7fc18d794e5d46d8ade2e479b9218/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65666672657976616e726f7373756d2f77702d6d61696c)](https://packagist.org/packages/jeffreyvanrossum/wp-mail)[![License](https://camo.githubusercontent.com/8045b345bfbac3a37353155548d8b9e94c9f5911de6a049882dfbca48370d402/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a65666672657976616e726f7373756d2f77702d6d61696c)](https://packagist.org/packages/jeffreyvanrossum/wp-mail)

WP Mail
=======

[](#wp-mail)

For those wanting to send good looking WordPress emails with a fluent API.

[![Example](art/example.png)](art/example.png)

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

[](#installation)

```
composer require jeffreyvanrossum/wp-mail
```

Usage
-----

[](#usage)

You can either build your email using the builder pattern or you can use a view.

```
use Jeffreyvr\WPMail\Mail;

Mail::make()
    ->to('jane@doe.com')
    ->subject('Hello')
    ->line(text: 'Hello there')
    ->button(text: 'Click me', url: 'https://vanrossum.dev')
    ->line(text: 'Kind regards, Jeffrey')
    ->send();
```

### Available Methods

[](#available-methods)

- `subject(string $subject)` - Set the email subject
- `preview(string $preview)` - Set the preview text
- `to(string $email, string $name = '')` - Add recipient
- `cc(string $email, string $name = '')` - Add CC recipient
- `bcc(string $email, string $name = '')` - Add BCC recipient
- `from(string $email, string $name = '')` - Set sender information
- `line(string|callable $text)` - Add a text line to the email
- `button(string $text, string $url)` - Add a call-to-action button
- `view(string $path, array $data = [])` - Use a view template
- `plainText(string|callable $plainText)` - Set the plain text version of the email
- `unsubscribeUrl(string $unsubscribeUrl)` - Set the unsubscribe URL
- `unsubscribeText(string $unsubscribeText)` - Set the unsubscribe text
- `send()` - Send the email

In the view you can use `$mail` to access the mail object.

Want to schedule emails as a background job?
--------------------------------------------

[](#want-to-schedule-emails-as-a-background-job)

Take a look at [wp-job-scheduler](https://github.com/jeffreyvr/wp-job-scheduler). Simply create a job and add the mail sending logic to the handle method.

Credits
-------

[](#credits)

- [Responsive HTML Email Template](https://github.com/leemunroe/responsive-html-email-template)

Contributors
------------

[](#contributors)

- [Jeffrey van Rossum](https://github.com/jeffreyvr)
- [All contributors](https://github.com/jeffreyvr/wp-mail/graphs/contributors)

License
-------

[](#license)

MIT. Please see the [License File](/LICENSE) for more information.

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance76

Regular maintenance activity

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Total

4

Last Release

159d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ca71465f93459010e10f39821b541f1c00c61233c48bcda0cea8a8d6fb6988?d=identicon)[jeffreyvr](/maintainers/jeffreyvr)

---

Top Contributors

[![jeffreyvr](https://avatars.githubusercontent.com/u/9550079?v=4)](https://github.com/jeffreyvr "jeffreyvr (7 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffreyvanrossum-wp-mail/health.svg)

```
[![Health](https://phpackages.com/badges/jeffreyvanrossum-wp-mail/health.svg)](https://phpackages.com/packages/jeffreyvanrossum-wp-mail)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
