Fix bugs in HTML styles and in unicode


 1. Fix style issue where HTML was formatted improperly.
 2. Fix bug where unicode was not treated properly, causing an unexpected exception when email is not configured correctly.