Made some changes to the processing of email contents and encoded Subject lines.