Skip to content

Commit

Permalink
Update mail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nitchandak authored May 3, 2024
1 parent 620624f commit 4443cb0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gemini/sample-apps/agent-assist/backend/src/utils/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ def send_email(self, to_mail, subject, body, file_path: Any = None) -> None:
with open(file_path, "rb") as fil:
part = MIMEApplication(fil.read(), Name=basename(file_path))
# After the file is closed
part[
"Content-Disposition"
] = f'attachment; filename="{basename(file_path)}"'
content_dis = f'attachment; filename="{basename(file_path)}"'
part["Content-Disposition"] = content_dis
msg.attach(part)

server = smtplib.SMTP("smtp.gmail.com", 587)
Expand Down

0 comments on commit 4443cb0

Please sign in to comment.