
Raja Sekhar - 2011-12-05 20:22:42
Hi
We are using the MIME Parser to do some inbound email processing for a mailing list and then form the the e-mail again and send that to few member email ids.
One issue we are facing is the introduction of special characters (such as ����) in the email when we parse the email that was sent from gmail account from the browser. The characters appear randomly in place of whitespaces or newlines. I am pasting the code below we are using (stripped the logging/error handling etc.)
$mime=new mime_parser_class;
$mime->decode_bodies = 1;
$mime->ignore_syntax_errors = 1;
$mime->track_lines = 1;
$mime->decode_headers = 1;
$mime->decode_bodies = 1;
$parameters=array('Data'=>$raw_email, 'SkipBody'=>0);
$mime->Decode($parameters, $decoded);
$mime->Analyze($decoded[$message], $results));
This does not happen for any other emails - only for emails sent from gmail over the web. We are not able to figure out the reason for this, though it looks like some character encoding issue. Any pointers would be appreciated.