added try statements to some email stuff to prevent unforeseen crashing