Small modifications to send_mail