PHP code example of mambaru / smtpd
1. Go to this page and download the library: Download mambaru/smtpd library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mambaru / smtpd example snippets
heFox\Smtp\Server;
use TheFox\Smtp\Event;
$server = new Server('127.0.0.1', 20025);
$server->init();
$server->listen();
$event1 = new Event(Event::TRIGGER_MAIL_NEW, null, function($event, $from, $rcpt, $mail){
// Do stuff: DNS lookup the MX record for the recipient's domain, ...
});
$server->eventAdd($event1);
$server->loop();