implemented sending of mails