Created
September 18, 2015 12:57
-
-
Save mymizan/4d481fd01d4b10915cff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
# create a filename for the emlx file | |
list($ms, $time) = explode(' ', microtime()); | |
//$filename = '/tmp/testmail/'.date('Y-m-d h.i.s,', $time).substr($ms,2,3).'.emlx'; | |
$filename = '/tmp/dummymail.txt'; | |
# write the email contents to the file | |
$email_contents = fopen('php://stdin', 'r'); | |
$fstat = fstat($email_contents); | |
file_put_contents($filename, $fstat['size']."\n", FILE_APPEND); | |
file_put_contents($filename, $email_contents, FILE_APPEND); | |
file_put_contents($filename, $fstat['size']." ---- END --- \n \n", FILE_APPEND); | |
# open up the emlx file (using Apple Mail) | |
//disable opening mail client | |
//exec('open '.escapeshellarg($filename)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment