I am using the below code to receives piped emails.
When I review the email after the script has read it, it's filled with all kinds of characters with the email message buried within. How can I extract the email message from the $email variable?
Or do I have to change the way it is reading the email?
I also want to be able to get attachments on emails.
Is there a better solution?
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
$email .= fread($fd, 1024);