mailer functionality

Added mailer functionality