update to python fastpi

This commit is contained in:
Iliyan Angelov
2025-11-16 15:59:05 +02:00
parent 93d4c1df80
commit 98ccd5b6ff
4464 changed files with 773233 additions and 13740 deletions

View File

@@ -0,0 +1,30 @@
from aiosmtplib.smtp import SMTP, SMTP_PORT
raw_hostname = input("SMTP server hostname [localhost]: ") # nosec
raw_port = input(f"SMTP server port [{SMTP_PORT}]: ") # nosec
raw_sender = input("From: ") # nosec
raw_recipients = input("To: ") # nosec
hostname = raw_hostname or "localhost"
port = int(raw_port) if raw_port else SMTP_PORT
recipients = raw_recipients.split(",")
lines = []
print("Enter message, end with ^D:")
while True:
try:
lines.append(input()) # nosec
except EOFError:
break
message = "\n".join(lines)
message_len = len(message.encode("utf-8"))
print(f"Message length (bytes): {message_len}")
smtp_client = SMTP(hostname=hostname or "localhost", port=port, start_tls=False)
sendmail_errors, sendmail_response = smtp_client.sendmail_sync(
raw_sender, recipients, message
)
print(f"Server response: {sendmail_response}")