diff --git a/changelogs/fragments/44552-mail-py370-compat.yml b/changelogs/fragments/44552-mail-py370-compat.yml new file mode 100644 index 00000000000..d72c3b75857 --- /dev/null +++ b/changelogs/fragments/44552-mail-py370-compat.yml @@ -0,0 +1,2 @@ +bugfixes: +- fix mail module for python 3.7.0 (https://github.com/ansible/ansible/pull/44552) diff --git a/lib/ansible/modules/notification/mail.py b/lib/ansible/modules/notification/mail.py index 4598690f878..e1713e90d9e 100644 --- a/lib/ansible/modules/notification/mail.py +++ b/lib/ansible/modules/notification/mail.py @@ -248,7 +248,7 @@ def main(): try: if secure != 'never': try: - smtp = smtplib.SMTP_SSL(timeout=timeout) + smtp = smtplib.SMTP_SSL(host=host, timeout=timeout) code, smtpmessage = smtp.connect(host, port=port) secure_state = True except ssl.SSLError as e: