Skip to content

Commit

Permalink
made cc_emails field optional in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaval055 committed Apr 22, 2024
1 parent b03e318 commit 9a75d95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions email/1.3.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 9a75d95

Please sign in to comment.