PHPackages                             gribanov/sendmail - 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. gribanov/sendmail

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

gribanov/sendmail
=================

Library for send mail

v1.6.2(8y ago)347MITPHPPHP &gt;=5.3.0CI failing

Since Apr 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/peter-gribanov/sendmail)[ Packagist](https://packagist.org/packages/gribanov/sendmail)[ Docs](https://github.com/peter-gribanov/sendmail)[ RSS](/packages/gribanov-sendmail/feed)WikiDiscussions master Synced 1mo ago

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

sendmail
========

[](#sendmail)

[![Latest Stable Version](https://camo.githubusercontent.com/f2c455103bac7806170bca96e5517acffc219bb5bf556af08ac8757ae6f62def/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030266c6162656c3d737461626c65)](https://packagist.org/packages/gribanov/sendmail)[![Total Downloads](https://camo.githubusercontent.com/1a8735534d6c0447e5c290887c191c32087d00ce3d713242d3a77010a2513a83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030)](https://packagist.org/packages/gribanov/sendmail)[![Build Status](https://camo.githubusercontent.com/17051ed798f42e3afeb367d2fb86eecdac66ca5a6fa367cdd3f5295c9f32fd95/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70657465722d67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030)](https://travis-ci.org/peter-gribanov/sendmail)[![Coverage Status](https://camo.githubusercontent.com/b68d388835d3219555440ef9e32c1f96428db4f08107004fbcf7540b8d93dc68/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70657465722d67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030)](https://coveralls.io/github/peter-gribanov/sendmail?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/83881df826d9c35b903e39e2e0e0d3f452e37e22d4fb67da95494ed64a224572/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70657465722d67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030)](https://scrutinizer-ci.com/g/peter-gribanov/sendmail/?branch=master)[![SensioLabs Insight](https://camo.githubusercontent.com/12d37e7868fcccd6013598a85dadfe4a93a8ff9a271d03f09720494879f462f3/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f30333933663534372d633432392d343765662d383235352d3436303764366534303233312e7376673f6d61784167653d33363030266c6162656c3d534c496e7369676874)](https://insight.sensiolabs.com/projects/0393f547-c429-47ef-8255-4607d6e40231)[![StyleCI](https://camo.githubusercontent.com/69a9f138d1ad2e0f5619be01167e9fa4f9fba96fc323d4d89c7af6cd1fd47683/68747470733a2f2f7374796c6563692e696f2f7265706f732f33333331303632322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/33310622)[![License](https://camo.githubusercontent.com/921dc55ac4fc63fcd7867ca824b697c4409f8bc1f3b3a391d7076c7b8b4f6ea3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f67726962616e6f762f73656e646d61696c2e7376673f6d61784167653d33363030)](https://github.com/peter-gribanov/sendmail)

Package for send mails.

Examples
--------

[](#examples)

### Send mail from mail() function

[](#send-mail-from-mail-function)

Send one message by the PHP function [mail()](http://php.net/manual/en/book.mail.php)

```
use Sendmail\Message;
use Sendmail\Sender\Mail;

$message = new Message();
$message
    ->setTo('user@example.com')
    ->setSubject('Example subject')
    ->setText('Example message');
$sender = new Mail();
$sender->send($message);
```

### Send mail from SMTP

[](#send-mail-from-smtp)

Connect to SMTP server and push mails into him

```
use Sendmail\Queue;
use Sendmail\Message;
use Sendmail\Sender\Smtp;
use Sendmail\Sender\Smtp\Exception;

$message1 = new Message();
$message1
    ->setTo('user1@example.com')
    ->setSubject('Example subject 1')
    ->setText('Example message 1')
    // email of the sender
    ->setFrom('sender@example.com', 'Sender');

$message2 = clone $message1;
$message2
    ->setTo('user2@example.com')
    ->setSubject('Example subject 2')
    ->setText('Example message 2');

// sending messages to the queue via a direct connection to the SMTP server
$queue = new Queue(new Smtp('example.com', 25, 'username', 'password'));
$queue
    ->add($message1)
    ->add($message2);

try {
    // send all messages
    var_dump($queue->send());
} catch (Exception $e) {
    // SMTP dialogue
    echo $e->getDialogue()->getLog();
}

$queue->clear();
```

### Creation mailing list

[](#creation-mailing-list)

```
use Sendmail\Queue;
use Sendmail\Message;
use Sendmail\Sender\Mail;

$message = new Message();
$message
    ->setSubject('Example subject')
    ->setText('Example message.You can remove this message.')
    // email of the sender
    ->setFrom('sender@example.com')
    // send email in HTML format
    ->inHTML();

$queue = new Queue(new Mail());
// add to queue a letter addressed to multiple recipients
$queue->notify(
    array(
        'user1@example.com',
        'user2@example.com',
        'user3@example.com'
    ),
    $message
);

$queue->send();
$queue->clear();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3093d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a6415c83577efe7b70d9ae4a3bb12958adc11c16e530ff844ff217b0fd0c54a?d=identicon)[Peter Gribanov](/maintainers/Peter%20Gribanov)

---

Top Contributors

[![peter-gribanov](https://avatars.githubusercontent.com/u/1954436?v=4)](https://github.com/peter-gribanov "peter-gribanov (89 commits)")

---

Tags

mailphpsendmailsmtp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gribanov-sendmail/health.svg)

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

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/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)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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