inlined version of the mailer.