From 89ed643f6b3967656b7817284ca26f8bab549b99 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Tue, 12 Oct 2021 18:22:53 +0200 Subject: [PATCH] #16 fix login for SMTP --- diffido.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffido.py b/diffido.py index 98172de..c17f2b3 100755 --- a/diffido.py +++ b/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)