...and:1) it sends the email even if it should not (the connection is successful)2) after running: python script.py the pointer does not stop flashing as if the script will run forever hence I don't have my prompt me@debian:-$ back as it does when a script has finished executing.

Having the except commented out I get into an endless loop of:Connected!Connected!Connected!etc etc

So my first objective is to have Python check the connection and if the connection is achieved have just 1 Connected! printed out. That is to say if the connection is a success stop checking. If instead 3 connection attempts are failed then go and parse the except bit....any ideas?Thank you