Try changing your content type to 'text/plain' or escape the html with something like
HTML::Entities. I have a feeling that $body contains the correct stuff, its just getting misinterpreted somewhere between the variable and the 'view source' window of your browser...
-Blake