mailer functionality improved