added mailer functionality