Ok maybe i wrote it a bit wrong what the problem is.. here is exactly what im doing..
Now i created a web-based email program, no im at the point where once you selected a new incoming message and you go to readmail.php3
This lets you view the message you selected.
Now teh code to grab the email header information is fine.. in your email header i have a variable to print the From: information which is $fromperson.
If you emailed me the $fromperson would be something like
"Brett" <brett@socket7.net>
So $fromperson code is already set.
If i did echo $fromperson it would print
"Brett" <brett@socket7.net>
Now im usinjg your exact code but now instead of using $from im using $fromemail
seems to me like it shouldnt be a problem but.
Here is all the code that might help understand.
Code im using to just take email from From:
$email_only = substr($fromperson, (strrpos($fromperson, "<")+1), -1);
Code to get $fromperson:
f(strcasecmp(substr($buffer,0,5),"From:")==0) {
$fromperson=substr($buffer,6,strlen($buffer)-6);
$fromperson=htmlspecialchars($fromperson);