I've been capturing the body of email messages with PHP using the following code:
$fd = fopen("php://stdin", "r");
$email_content = "";
while (!feof($fd)) {
$email_content .= fread($fd, 1024);
}
fclose($fd)
So, the way its set up is mail is forwarded to the PHP script.
Works great when I send a email from a gmail account to the server email account. Message is forwared to the PHP, and PHP stores the body of the message to a variable.
But others have sent emails to my server containing HTML which doesn't work. Why wouldn't my code above be able to capture the contents of the email if it contains HTML?