switch from print logging to using the logging system.  Raise error when you can't start an email session.