use deferToThread in the sendMail. Closes: #3937