25 lines
653 B
Python
25 lines
653 B
Python
# pip install python-smail cryptography asn1crypto
|
|
import json
|
|
from functions.send_email import send_email
|
|
from functions.create_encrypted_signed_email import create_encrypted_signed_email
|
|
|
|
with open("config.json", "r") as file:
|
|
config: dict = json.load(file)
|
|
|
|
recipient_email: str = "davrot@uni-bremen.de"
|
|
subject: str = "Test Subject"
|
|
body: str = "Test Body...."
|
|
|
|
msg = create_encrypted_signed_email(
|
|
recipient_email=recipient_email,
|
|
subject=subject,
|
|
body=body,
|
|
config_dict=config,
|
|
)
|
|
|
|
if msg is None:
|
|
print(f"Certificate for {recipient_email} not available")
|
|
exit(1)
|
|
|
|
send_email(email_data=msg, config_dict=config)
|
|
exit(0)
|