diff --git a/ip2e-config.py b/ip2e-config.py index dd2ab2e..eb7ebf4 100755 --- a/ip2e-config.py +++ b/ip2e-config.py @@ -80,3 +80,28 @@ print ("") readfile=open('ip2e-conf.py', 'r') print(readfile.read()) readfile.close() + +#Test connection with your configuration +print ("") +TestConnection=input("Test connection with your configuration (y/n): ") +if TestConnection == "y": + exec(open("ip2e-conf.py").read()) + #Import smtplib + import smtplib + try: + server = smtplib.SMTP(SmtpFromEmail) + server.ehlo() + server.starttls() + server.ehlo() + server.login(FromEmailUser,FromEmailPass) + server.quit() + print ("") + print ("Test OK") + print ("") + except: + print ("") + print ("Failed to connect ("+SmtpFromEmail+")") + print ("") +else: + print ("Exiting...") + exit(0)