mailer functionality with customization