PHPackages                             shuchkin/react-smtp-client - 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. shuchkin/react-smtp-client

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

shuchkin/react-smtp-client
==========================

ReactPHP async SMTP Client

0.2(6y ago)245.7k↓100%3MITPHPPHP &gt;=5.3.0

Since Mar 12Pushed 6y ago3 watchersCompare

[ Source](https://github.com/shuchkin/react-smtp-client)[ Packagist](https://packagist.org/packages/shuchkin/react-smtp-client)[ Docs](https://github.com/shuchkin/react-smtp-client)[ RSS](/packages/shuchkin-react-smtp-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

react-smtp-client v0.2
======================

[](#react-smtp-client-v02)

[ReactPHP](https://reactphp.org/) async SMTP client to send a emails like php mail(). Simple UTF-8 text/plain messages out-of-the-box.

Basic Usage
-----------

[](#basic-usage)

```
$loop = \React\EventLoop\Factory::create();

$smtp = new \Shuchkin\ReactSMTP\Client( $loop ); // localhost:25

$smtp->send('info@example.org', 'sergey.shuchkin@gmail.com', 'Test ReactPHP mailer', 'Hello, Sergey!')->then(
    function() {
        echo 'Message sent'.PHP_EOL;
    },
    function ( \Exception $ex ) {
        echo 'SMTP error '.$ex->getCode().' '.$ex->getMessage().PHP_EOL;
    }
);

$loop->run();
```

Google SMTP Server – How to send bulk emails for free
-----------------------------------------------------

[](#google-smtp-server--how-to-send-bulk-emails-for-free)

```
$loop = \React\EventLoop\Factory::create();

$smtp = new \Shuchkin\ReactSMTP\Client( $loop, 'tls://smtp.gmail.com:465', 'username@gmail.com','password' );

$recipients = ['sergey.shuchkin@gmail.com','example@example.com'];

foreach( $recipients as $to ) {

    $smtp->send('username@gmail.com', $to, 'Test ReactPHP mailer', 'Hello, Sergey!')->then(
        function() use ( $to ) {
            echo 'Message to '.$to.' sent via Google SMTP'.PHP_EOL;
        },
        function ( \Exception $ex ) use ( $to ) {
            echo 'Message to '.$to.' not sent: '.$ex->getMessage().PHP_EOL;
        }
    );
}

$loop->run();
```

Google limit for personal SMTP 99 messages per 24 hours.

Using mime/mail class, send mails and attachments
-------------------------------------------------

[](#using-mimemail-class-send-mails-and-attachments)

See

```
$ composer require shuchkin/simplemail
```

```
$smtp = new \Shuchkin\ReactSMTP\Client( $loop, 'example.com:25', 'username', 'password' );

// setup fabric
$sm = new \Shuchkin\SimpleMail();
$sm->setFrom( 'example@example.com' );
$sm->setTransport( function ( \Shuchkin\SimpleMail $m, $encoded ) use ( $smtp ) {

    $smtp->send( $m->getFromEmail(), $encoded['to'], $encoded['subject'], $encoded['message'], $encoded['headers'] )
        ->then(
            function () {
                echo "\r\nSent mail";
            },
            function ( \Exception $ex ) {
                echo "\r\n" . $ex->getMessage();
            }
        );
});

// send mail
$sm->to( ['sergey.shuchkin@gmail.com', 'reactphp@example.com'] )
    ->setSubject('Async mail with ReactPHP')
    ->setText('Async mail sending perfect! See postcard')
    ->attach('image/postcard.jpg')
    ->send();
```

Install
-------

[](#install)

The recommended way to install this library is [through Composer](https://getcomposer.org). [New to Composer?](https://getcomposer.org/doc/00-intro.md)

This will install the latest supported version:

```
$ composer require shuchkin/react-smtp-client
```

Changelog
---------

[](#changelog)

0.2 (2020-02-19) - basic UTF-8 text/plain messages out-of-the-box, ReactPHP actual versions in composer.json

0.1.1 (2019-03-12) - Initial release

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

2271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/551f9169d9efadfa85ff5ff512eab17e9219ba10e42636d9a31f1021a1027395?d=identicon)[shuchkin](/maintainers/shuchkin)

---

Top Contributors

[![shuchkin](https://avatars.githubusercontent.com/u/315872?v=4)](https://github.com/shuchkin "shuchkin (17 commits)")

---

Tags

phpasyncmailreactphpsmtp

### Embed Badge

![Health badge](/badges/shuchkin-react-smtp-client/health.svg)

```
[![Health](https://phpackages.com/badges/shuchkin-react-smtp-client/health.svg)](https://phpackages.com/packages/shuchkin-react-smtp-client)
```

###  Alternatives

[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[clue/redis-react

Async Redis client implementation, built on top of ReactPHP.

28210.5M45](/packages/clue-redis-react)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[react/mysql

Async MySQL database client for ReactPHP.

340421.0k29](/packages/react-mysql)[clue/reactphp-eventsource

Instant real-time updates. Lightweight EventSource client receiving live messages via HTML5 Server-Sent Events (SSE). Fast stream processing built on top of ReactPHP's event-driven architecture.

5818.5k3](/packages/clue-reactphp-eventsource)[clue/ami-react

Streaming, event-driven access to the Asterisk Manager Interface (AMI), built on top of ReactPHP.

85110.1k10](/packages/clue-ami-react)

PHPackages © 2026

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