made sending email run on a new thread