This commit is contained in:
2025-11-10 06:09:45 +01:00
parent 1d32acfc5f
commit b7a7a62ba2
2 changed files with 30 additions and 1 deletions

View File

@@ -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}")

29
Emailtest/10 EmailTest.py Normal file
View File

@@ -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!")