Worked on more robust email handling