2017 © Pedro Peláez
 

library react-smtp

SMTP Server based on ReactPHP

image

sam-it/react-smtp

SMTP Server based on ReactPHP

  • Monday, January 16, 2017
  • by SamMousa
  • Repository
  • 3 Watchers
  • 8 Stars
  • 153 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 3 Versions
  • 63 % Grown

The README.md

react-smtp

SMTP Server based on ReactPHP, (*1)

It supports many concurrent STMP connections., (*2)

Scrutinizer Code Quality Code Coverage Build Status, (*3)

Usage example

Server:

include 'vendor/autoload.php';

$loop = React\EventLoop\Factory::create();
$server = new \SamIT\React\Smtp\Server($loop);
$server->listen(8025);
$server->on('message', function($from, array $recipients, \SamIT\React\Smtp\Message $message, \SamIT\React\Smtp\Connection $connection) {
    var_dump($message->getHeaders());
    var_dump($message->getBody()->getSize());
});
$loop->run();

Example client using PHPMailer:


include 'vendor/autoload.php'; $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = 'localhost'; $mail->Port = 8025; $mail->SMTPDebug = true; $mail->setFrom('from@example.com', 'Mailer'); $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient $mail->addAddress('ellen@example.com'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; }

The Versions

16/01 2017

dev-master

9999999-dev

SMTP Server based on ReactPHP

  Sources   Download

MIT

The Requires

 

16/01 2017

v0.0.2

0.0.2.0

SMTP Server based on ReactPHP

  Sources   Download

MIT

The Requires

 

05/01 2017

v0.0.1

0.0.1.0

SMTP Server based on ReactPHP

  Sources   Download

MIT

The Requires