added mailer, updated to production code