implement mailer functionality