added support for selecting message format (html or text)