Skip to content

Instantly share code, notes, and snippets.

@JamieChung
Created December 3, 2011 16:54
Show Gist options
  • Save JamieChung/1427555 to your computer and use it in GitHub Desktop.
Save JamieChung/1427555 to your computer and use it in GitHub Desktop.
Basic email piping
#!/usr/bin/php -q
<?php
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd))
{
$email .= fread($fd, 1024);
}
fclose($fd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment