Skip to content

Instantly share code, notes, and snippets.

@DKepov
Created February 1, 2019 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DKepov/c85addcd76b2b40e49f032fce113b5ee to your computer and use it in GitHub Desktop.
Save DKepov/c85addcd76b2b40e49f032fce113b5ee to your computer and use it in GitHub Desktop.
To /usr/sbin/sendmail
```php
#!/usr/bin/php
<?php
//====================================================
// Program : Fake send mail
// Author : pouletfou at gmail
// Description : save this file as /usr/sbin/sendmail
// and you can test your PHP applications using mail
// by looking at the /tmp/fakesendmail.log files.
//====================================================
define('LOGFILE','/tmp/fakesendmail.log');
$log = fopen (LOGFILE,'a+');
fwrite($log,"\n".implode(' ',$argv).
" called on : ".date('Y-m-d H:i:s')."\n");
fwrite($log,file_get_contents("php://stdin"));
fwrite($log,
"\n===========================================================\n");
fclose($log);
?>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment