Sending email functionality fixed