Re-structured send_mail_to_student funtion, tidied up docstrings and pep8