This reworks the previous commit and fix the incorrect readings. I would've rebased but my windows git is missing some commands for not so obvious reasons.
Complete error description here: http://www.flying-bits.org/tracker.php?p=33&t=978
Suggested by nickvergessen Added htmlspecialchars_decode for $message