I am struggling to get an Email_send() to work within a thread. It acts unpredictable, with errors crashing in the code although the email always sends. What am I doing wrong. My thread code is working fine otherwise. Will this function work inside a thread? Anyone doing this?