Added get log to patient, and added code to send mail