Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes MicrosoftGraphSender 2
  • Loading branch information
polsala committed Feb 24, 2025
commit 96ff297d1a9c3f13e6268f8a64fbf48c4d05990e
5 changes: 5 additions & 0 deletions qreu/sendcontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def sendmail(self, mail):
writer.write(mail.mime_string)
return True


class SMTPSender(Sender):
def __init__(
self, host='localhost', port=25, user=None, passwd=None,
Expand Down Expand Up @@ -129,6 +130,7 @@ def sendmail(self, mail):
from_mail, mail.recipients_addresses, mail.mime_string)
return True


class MicrosoftGraphSender(Sender):
"""
Sender context to send emails using Microsoft Graph API.
Expand Down Expand Up @@ -167,6 +169,9 @@ def __enter__(self):

return super(MicrosoftGraphSender, self).__enter__()

def __exit__(self, etype, evalue, etraceback):
super(MicrosoftGraphSender, self).__exit__(etype, evalue, etraceback)

def sendmail(self, mail):
"""
Send the qreu.Email object through Microsoft Graph API.
Expand Down
Loading