write Email to file (not working)