vendredi 15 décembre 2017

Why do I get a "Auth command already specified" when I use this If statement in Python

so I had a problem while trying to send an email with python on smtplib module. Everythink is working except the login. When I try to check if the program successfully connecnted I get the Auth command already specified error. But when I don't check I don't get this error so I come to the question where is the problem in this if statement? I'm new in smtplib guys so please don't be too hard.

try:
    provider.login(email, password)
    if (provider.login(email, password)[0]) == 235:
        print"Successfully logged in"
    else:
        print"Anmeldung fehlgeschlagen"
except Exception, e: #smtplib.SMTPAuthenticationError
    print(e)

Aucun commentaire:

Enregistrer un commentaire