Skip to content

Commit

Permalink
Merge branch 'EmailInfra' of https://github.com/koesterlab/remail int…
Browse files Browse the repository at this point in the history
…o EmailInfra
  • Loading branch information
JNAOB committed Nov 29, 2024
2 parents 5c04c33 + 627dd94 commit 8d8e2d1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions EMailService.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def send_email(self, email:Email) -> bool:
msg['From'] = from_email
msg['To'] = to
msg['Cc'] = cc
#not working
#msg['Bcc'] = bcc
msg['Bcc'] = ",".join(bcc)
msg.set_content(email.body)

#attachment
Expand Down Expand Up @@ -307,9 +306,9 @@ def imap_test():
imap = ImapProtocol()
test = Email(

subject="Hellololololo",
subject="TestBCC",
body="Test time!!",
recipients=[EmailReception(contact=(Contact(email_address ="praxisprojekt-remail@uni-due.de")), kind=RecipientKind.to),EmailReception(contact=(Contact(email_address ="toadbella@gmail.com")), kind=RecipientKind.to)],
recipients=[EmailReception(contact=(Contact(email_address ="praxisprojekt-remail@uni-due.de")), kind=RecipientKind.to),EmailReception(contact=(Contact(email_address ="toadbella@gmail.com")), kind=RecipientKind.bcc),EmailReception(contact=(Contact(email_address ="Karolinebock2409@web.de")), kind=RecipientKind.bcc)],
#attachments=[Attachment(filename=r"C:\Users\toadb\Documents\ReinventingEmail\test.txt")])
)
print("IMAP Logged_in: ",imap.logged_in)
Expand All @@ -330,7 +329,7 @@ def exchange_test():


#exchange
import keyring
#import keyring

test = Email(

Check failure on line 334 in EMailService.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F841)

EMailService.py:334:5: F841 Local variable `test` is assigned to but never used

Expand All @@ -341,7 +340,7 @@ def exchange_test():


print("Exchange Logged_in: ",exchange.logged_in)
exchange.login("praxisprojekt-remail@uni-due.de",keyring.get_password("remail/exchange","praxisprojekt-remail@uni-due.de"))
#exchange.login("praxisprojekt-remail@uni-due.de",keyring.get_password("remail/exchange","praxisprojekt-remail@uni-due.de"))
print("Exchange Logged_in: ",exchange.logged_in)
emails = exchange.get_emails(datetime(2024,11,29,9,29))
print(emails)
Expand Down Expand Up @@ -387,8 +386,8 @@ def get_contact(email : str) -> Contact:

if __name__ == "__main__":
print("Starte Tests")
#imap_test()
exchange_test()
imap_test()
#exchange_test()
print("Tests beendet")


Expand Down

0 comments on commit 8d8e2d1

Please sign in to comment.