Solutionabc
asked on
PHP read email
Hi,
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?
thanks.
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?
thanks.
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd))
{
$email .= fread($fd, 1024);
}
fclose($fd);
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
http://www.weberdev.com/get_example-1607.html
thanks,