Fixed missing import and added test to send_mail.