Handler to send emails. Not finished.