Send emails in a thread to avoid delay in the response