diff --git a/861 improvement formatting.py b/861 improvement formatting.py index 8f166e3..1564fab 100644 --- a/861 improvement formatting.py +++ b/861 improvement formatting.py @@ -296,4 +296,4 @@ for sheet_name, keywords in VACCINE_SHEETS.items(): wb.save(xlsx_path) -print(f"📘 Exported clean agenda view to:\n{xlsx_path}") +print(f"📘 Exported clean agenda view to:\n{xlsx_path}") \ No newline at end of file diff --git a/Emailtest/10 EmailTest.py b/Emailtest/10 EmailTest.py new file mode 100644 index 0000000..14754f9 --- /dev/null +++ b/Emailtest/10 EmailTest.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import smtplib +from email.message import EmailMessage + +# ========= CONFIG ========= +SMTP_SERVER = "smtp.office365.com" +SMTP_PORT = 587 +EMAIL_FROM = "ordinace@buzalkova.cz" +EMAIL_TO = "vladimir.buzalka@buzalka.cz" +SMTP_USER = "ordinace@buzalkova.cz" +SMTP_PASS = "********" # <- your Office365 APP PASSWORD (see note below) +# ========================== + +# Create the email +msg = EmailMessage() +msg["Subject"] = "Test zpráva z Pythonu" +msg["From"] = EMAIL_FROM +msg["To"] = EMAIL_TO +msg.set_content("Dobrý den,\n\ntoto je testovací e-mail odeslaný z Python skriptu.\n\n--\nOrdinace MUDr. Buzalková") + +# Send the email +with smtplib.SMTP(SMTP_SERVER, SMTP_PORT) as server: + server.starttls() # enable TLS encryption + server.login(SMTP_USER, SMTP_PASS) + server.send_message(msg) + +print("✅ E-mail byl úspěšně odeslán!")