PHPackages                             anthonybudd/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. anthonybudd/wp\_mail

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

anthonybudd/wp\_mail
====================

v2.0(8y ago)9215.3k↓50%25[3 issues](https://github.com/anthonybudd/WP_Mail/issues)[1 PRs](https://github.com/anthonybudd/WP_Mail/pulls)PHP

Since May 16Pushed 3y ago10 watchersCompare

[ Source](https://github.com/anthonybudd/WP_Mail)[ Packagist](https://packagist.org/packages/anthonybudd/wp_mail)[ RSS](/packages/anthonybudd-wp-mail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

WP\_Mail - Send Dynamic Templated Emails with WordPress
=======================================================

[](#wp_mail---send-dynamic-templated-emails-with-wordpress)

WP\_Mail is the most popular, simplest and powerful dynamic email class available for WordPress. The class provides simple methods for attaching files, custom headers and lots of helper functions. The class only sends emails using the WordPress function wp\_mail() , this means that all of your existing SMTP settings will continue to work with no additional config or set-up required.

```
$email = WP_Mail::init()
    ->to('john.doe@gmail.com')
    ->subject('WP_Mail is great!')
    ->template(get_template_directory() .'/emails/demo.php', [
        'name' => 'Anthony Budd',
        'location' => 'London',
        'skills' => [
           'PHP',
           'AWS',
        ]
    ])
    ->send();
```

email.html

```
You have a new contact from enquirey!

  Name:

  email:
