PHPackages                             rdelbem/wp-mailer-class - 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. rdelbem/wp-mailer-class

ActiveWordpress-utility-class[Mail &amp; Notifications](/categories/mail)

rdelbem/wp-mailer-class
=======================

Just a simple wrapper around the wp\_mail function, now you can easily send an email from within WP without having to set a header by youself. We also provide some error handling

1.0.2(2y ago)115GPL-3.0-or-laterPHPPHP &gt;=8.0

Since Jan 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rdelbem/WP-mailer-class)[ Packagist](https://packagist.org/packages/rdelbem/wp-mailer-class)[ RSS](/packages/rdelbem-wp-mailer-class/feed)WikiDiscussions main Synced 1mo ago

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

Simple WordPress Mailer class
-----------------------------

[](#simple-wordpress-mailer-class)

The intention of this snippet is to facilitate the use of wp\_mail native function. Normally, when using, wp\_mail, some parameters are required in order for it to work: headers, subject, body etc.

If all you have is the user id, you will need to use other WordPress function to get the email and, only then, pass it to wp\_mail. While, coding a plugin or a theme, this will require a different file and class, as calling all this wp functions will, most certanly, make a mess in your code.

However, if you use WPMailerClass, you only need to provide ONE relevant receiver data, id OR email. See the examples:

Here, only id is provided

```
$send_mail = new WPMailerClass( 1, 'Amazing subject!', 'Amazing message!' );
$send_mail->sendEmail();
```

Here, only e-mail is provided

```
$send_mail = new WPMailerClass( 'youruser@mail.com', 'Amazing subject!', 'Amazing message!' );
$send_mail->sendEmail();
```

And if you want to defensive handle errors you can do the following

```
$send_mail = new WPMailerClass( 'youruser@mail.com', 'Amazing subject!', 'Amazing message!' );
$result = $send_mail->sendEmail();

if($result instanceof WP_Error){
    error_log($result->get_error_message()); // this will log 'WPMailerClass could not send email'
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~70 days

Total

3

Last Release

1056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c8db776d3e8c20972e78cb09748a74b12fc6e96b1bdba7b4938067462c95be1?d=identicon)[rdelbem](/maintainers/rdelbem)

---

Top Contributors

[![rdelbem](https://avatars.githubusercontent.com/u/5652782?v=4)](https://github.com/rdelbem "rdelbem (14 commits)")

---

Tags

emailmailwordpress

### Embed Badge

![Health badge](/badges/rdelbem-wp-mailer-class/health.svg)

```
[![Health](https://phpackages.com/badges/rdelbem-wp-mailer-class/health.svg)](https://phpackages.com/packages/rdelbem-wp-mailer-class)
```

###  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)
