FakeSMTPServerScript is just a basic and simple PHP script to build a fake SMTP server.
- Setup the server address and port to be listen on, default config:
$address = 'smtp.goodsane.com';
$port = 6006;
- Get a SSL certificate (Self-signed certificate will not be supported)
- Run the script with
php index.php
- For default, the script will captures all email sent to it and print on terminal.
Modify the path for certificate and private key files before run
'local_cert' => '/home/mailblast/ssl/Cert.crt',
'local_pk' => '/home/mailblast/ssl/Private.key',
These resources will be helpful for anyone who want to know behind the codes :
- axllent / fake-smtp
- ReachFive / fake-smtp-server
- Writing a webserver in pure PHP - Tutorial
- PHP Simple TCP/IP server
- Beej's Guide to Network Programming
- List of All SMTP Commands and Response Codes
- What Happens in a TLS Handshake?
- Taking a Closer Look at the SSL/TLS Handshake
- Debugging SMTP Conversations Part 1: How to Speak SMTP
- HOWTO: PHP TCP Server/Client with SSL Encryption using Streams