Made sendAsHtml more elegant