Browse Source

#16 fix login for SMTP

Davide Alberani 2 years ago
parent
commit
89ed643f6b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      diffido.py

+ 1 - 1
diffido.py

@@ -327,7 +327,7 @@ def send_email(to, subject='diffido', body='', from_=None):
                     logger.debug('STMP STARTTLS connection with args: %s' % repr(tls_args))
                     s.ehlo_or_helo_if_needed()
                     s.starttls(**tls_args)
-                if args.get('username'):
+                if username:
                     logger.debug('STMP LOGIN for username %s and password of length %d' % (username, len(password)))
                     s.login(username, password)
                 s.send_message(msg)