Fixed errors in the code for sending e-mails.