changes to the Email behaivior
This commit is contained in:
@@ -9,16 +9,14 @@ import Web.modules.database.settings as cfg
|
||||
|
||||
def _build_smtp_client():
|
||||
smtp = smtplib.SMTP(
|
||||
cfg.EMAIL_SMTP_HOST,
|
||||
cfg.EMAIL_SMTP_PORT,
|
||||
timeout=cfg.EMAIL_TIMEOUT_SECONDS,
|
||||
"mail.invario-software.de",
|
||||
587,
|
||||
timeout=1,
|
||||
)
|
||||
smtp.ehlo()
|
||||
if cfg.EMAIL_USE_TLS:
|
||||
smtp.starttls()
|
||||
smtp.ehlo()
|
||||
if cfg.EMAIL_USERNAME:
|
||||
smtp.login(cfg.EMAIL_USERNAME, cfg.EMAIL_PASSWORD or "")
|
||||
smtp.starttls()
|
||||
smtp.ehlo()
|
||||
smtp.login("no-reply@invario-software.de", "#,EATwIn,68")
|
||||
return smtp
|
||||
|
||||
|
||||
@@ -76,7 +74,7 @@ def _send_message(email: list | str, subject: str, note: str, sender: str, attac
|
||||
|
||||
msg = MIMEMultipart("mixed" if attachment else "alternative")
|
||||
msg["Subject"] = str(subject)
|
||||
from_address = cfg.EMAIL_FROM_ADDRESS or cfg.EMAIL_USERNAME or "no-reply@invario-software.de"
|
||||
from_address = "no-reply@invario-software.de"
|
||||
msg["From"] = f"{sender} <{from_address}>"
|
||||
msg["To"] = str(recipient)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user