mailer conversion and fixes

mailer conversion and fixes