Is this markup being buffered and sent in the email body, or is this being displayed on screen? If on screen, this should be in a view.