Fix to handle scenario when there is only one student.
Escape some special characters that caused sending mail
to fail.