Changed calls to sendEmail so that State changes will occur when sending emails.