Add try catch to connect to mail server