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

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

pyrsmk/mail
===========

A simple mail sender

0.6.8(9y ago)17111MITPHPPHP &gt;=5.3.0

Since Mar 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pyrsmk/Mail)[ Packagist](https://packagist.org/packages/pyrsmk/mail)[ RSS](/packages/pyrsmk-mail/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (9)Used By (0)

Mail 0.6.8
==========

[](#mail-068)

Mail is a small library that aims to provide a light and simple mail implementation.

Installing
----------

[](#installing)

Pick up the source or install it with [Composer](https://getcomposer.org/) :

```
composer require pyrsmk/mail

```

Sending a basic e-mail
----------------------

[](#sending-a-basic-e-mail)

Mail is built on top of Chernozem to have an ease to use configuration.

```
$mail = new Mail;
$mail['from'] = 'lionel@example.org';
$mail['to'] = 'peter@another-site.org';
$mail['subject'] = 'Hey, I saw you last night!';
$mail['body'] = 'I saw you. Or not.';
$mail->send();
```

And that's all if you want to send a basic e-mail! Pretty simple, isn't it?

But we have a problem. Our address will be shown as `from@example.org` and that is really ugly. Let's correct this :

```
$mail['from'] = array('Lionel McGonagall'=>'lionel@example.org');
```

It will be shown like this : `Lionel McGonagall `.

Sending to more than one recipient works the same way :

```
$mail['to'] = array(
    'Peter' => 'peter@another-site.org',
    'Anaïs' => 'anais@wonderful.net',
    'Grandma' => 'iam@old.com'
);
```

That syntax works for `cc` and `bcc` parameters too. Note that `sender` and `replyto` are accessible too but only with the simple `email` syntax :

```
$mail['sender'] = 'peter@another-site.org';
$mail['replyto'] = 'anais@wonderful.net';
```

Sending a more complex e-mail
-----------------------------

[](#sending-a-more-complex-e-mail)

Let's say we want to send a billing e-mail to an user from our site with an eye-candy design in HTML, a text fallback and a PDF file attachment. That's how we can proceed :

```
$mail['html'] = 'An awesome title for an awesome bill';
$mail['body'] = 'Your mail client does not support HTML rendering. So bad.';
$mail['attachments'] = array(__DIR__.'/my_generated_bill.pdf');
```

That's all we need as configuration ;)

You can also define a filename for an attachment file :

```
$mail['attachments'] = array(
	$_FILES['image1']['name'] => $_FILES['image1']['tmp_name'],
	$_FILES['image2']['name'] => $_FILES['image2']['tmp_name']
);
```

E-mail validation
-----------------

[](#e-mail-validation)

Additionally, you can validate an e-mail address :

```
if(Mail::validate('lionel@example.org')){
    echo 'The e-mail address is valid';
}
else{
    echo 'The e-mail address is NOT valid';
}
```

License
-------

[](#license)

[MIT](http://dreamysource.mit-license.org) in your face.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Recently: every ~62 days

Total

8

Last Release

3641d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f97d81cfd6d30587cdae24925bc0899331394d723d04ee4b76eb9435a565fe9?d=identicon)[pyrsmk](/maintainers/pyrsmk)

---

Tags

mailsendsmtpSendersending

### Embed Badge

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

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

###  Alternatives

[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[sendgrid/smtpapi

Build SendGrid X-SMTPAPI headers in PHP.

696.5M2](/packages/sendgrid-smtpapi)[mlocati/spf-lib

Parse, build and validate SPF (Sender Policy Framework) DNS records

67867.9k2](/packages/mlocati-spf-lib)[pear/net_smtp

An implementation of the SMTP protocol

263.0M16](/packages/pear-net-smtp)[txthinking/mailer

A very lightweight PHP SMTP mail sender

10098.9k3](/packages/txthinking-mailer)[thefox/smtpd

SMTP server (library) written in pure PHP.

1302.4k1](/packages/thefox-smtpd)

PHPackages © 2026

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