HMP / agents /notebook /mailer.py
GitHub Action
Sync from GitHub with Git LFS
b8989d2
raw
history blame
484 Bytes
# agents/notebook/mailer.py
def send_email(to_email: str, subject: str, body: str):
try:
msg = EmailMessage()
msg["Subject"] = subject
msg["From"] = "[email protected]"
msg["To"] = to_email
msg.set_content(body)
with smtplib.SMTP("localhost") as server:
server.send_message(msg)
return True
except Exception as e:
print(f"[!] Ошибка отправки email: {e}")
return False