24 lines
659 B
Python
Executable File
24 lines
659 B
Python
Executable File
import smtplib
|
|
from email.mime.text import MIMEText
|
|
|
|
SMTP_SERVER = "smtp.office365.com"
|
|
SMTP_PORT = 587
|
|
EMAIL_ADDRESS = "ddnsupdater@outlook.com"
|
|
EMAIL_PASSWORD = "ltehpesmqnkjenah"
|
|
TO_EMAIL = "rafjaniak@outlook.com"
|
|
|
|
msg = MIMEText("This is a test email from DDNS updater.")
|
|
msg["Subject"] = "Test Email"
|
|
msg["From"] = EMAIL_ADDRESS
|
|
msg["To"] = TO_EMAIL
|
|
|
|
try:
|
|
with smtplib.SMTP(SMTP_SERVER, SMTP_PORT) as server:
|
|
server.ehlo()
|
|
server.starttls()
|
|
server.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
|
|
server.send_message(msg)
|
|
print("✅ Email sent successfully")
|
|
except Exception as e:
|
|
print(f"❌ Failed to send email: {e}")
|