From 9a75d9536f790ec17d09a6e4d857015ca8c387a9 Mon Sep 17 00:00:00 2001 From: dhaval055 Date: Mon, 22 Apr 2024 09:32:42 +0000 Subject: [PATCH] made cc_emails field optional in Python --- email/1.3.0/src/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email/1.3.0/src/app.py b/email/1.3.0/src/app.py index 0da967ce..0b7feb45 100644 --- a/email/1.3.0/src/app.py +++ b/email/1.3.0/src/app.py @@ -75,7 +75,7 @@ def send_email_shuffle(self, apikey, recipients, subject, body): return requests.post(url, headers=headers, json=data).text def send_email_smtp( - self, smtp_host, recipient, cc_emails ,subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html", + self, smtp_host, recipient, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html", cc_emails="" ): if type(smtp_port) == str: try: @@ -113,7 +113,7 @@ def send_email_smtp( msg["To"] = recipient msg["Subject"] = subject - if cc_emails: + if cc_emails != None and len(cc_emails) > 0: msg["Cc"] = cc_emails msg.attach(MIMEText(body, body_type))