improvement for sending mails