Skip to content

Commit

Permalink
added date to Email object
Browse files Browse the repository at this point in the history
imported datetime and added attribute date to Email
  • Loading branch information
Mephisto2409 committed Nov 29, 2024
1 parent 1ce528a commit 627df2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions EMailService.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def send_email(self, email:Email) -> bool:

#connect/authenticate
smtp_server = SMTP_SSL(self.SMTP_HOST, port = SMTP_SSL_PORT)
#smtp_server.set_debuglevel(1)
smtp_server.login(SMTP_USER, SMTP_PASS)
smtp_server.send_message(msg)

Expand Down Expand Up @@ -295,7 +294,7 @@ def imap_test():
test = Email(

subject="Hellololololo",
body="World i wanna finally go home today!!!!",
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)],
#attachments=[Attachment(filename=r"C:\Users\toadb\Documents\ReinventingEmail\test.txt")])
)
Expand Down
Binary file modified __pycache__/email2.cpython-312.pyc
Binary file not shown.
5 changes: 3 additions & 2 deletions email2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List, Optional
import sqlalchemy
from sqlmodel import Field, SQLModel, Relationship, Session, create_engine, select

from datetime import datetime

def id_field(table_name: str):
sequence = sqlalchemy.Sequence(f"{table_name}_id_seq")
Expand Down Expand Up @@ -52,4 +52,5 @@ class Email(SQLModel, table=True):
subject: str
body: str
attachments: List[Attachment] = Relationship(back_populates="email")
recipients: List[EmailReception] = Relationship(back_populates="email")
recipients: List[EmailReception] = Relationship(back_populates="email")
date: datetime

0 comments on commit 627df2c

Please sign in to comment.