Update emailnotifications.py

Fixed bug where an exception occured and called on sys but it was not imported.