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():
|
def _build_smtp_client():
|
||||||
smtp = smtplib.SMTP(
|
smtp = smtplib.SMTP(
|
||||||
cfg.EMAIL_SMTP_HOST,
|
"mail.invario-software.de",
|
||||||
cfg.EMAIL_SMTP_PORT,
|
587,
|
||||||
timeout=cfg.EMAIL_TIMEOUT_SECONDS,
|
timeout=1,
|
||||||
)
|
)
|
||||||
smtp.ehlo()
|
smtp.ehlo()
|
||||||
if cfg.EMAIL_USE_TLS:
|
|
||||||
smtp.starttls()
|
smtp.starttls()
|
||||||
smtp.ehlo()
|
smtp.ehlo()
|
||||||
if cfg.EMAIL_USERNAME:
|
smtp.login("no-reply@invario-software.de", "#,EATwIn,68")
|
||||||
smtp.login(cfg.EMAIL_USERNAME, cfg.EMAIL_PASSWORD or "")
|
|
||||||
return smtp
|
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 = MIMEMultipart("mixed" if attachment else "alternative")
|
||||||
msg["Subject"] = str(subject)
|
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["From"] = f"{sender} <{from_address}>"
|
||||||
msg["To"] = str(recipient)
|
msg["To"] = str(recipient)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user