Use threads to send emails to avoid UI block