markup/email.py: use django email server settings
This commit is contained in:
@ -8,6 +8,8 @@ from email.message import EmailMessage
|
|||||||
from email.utils import formatdate
|
from email.utils import formatdate
|
||||||
from email.header import Header, make_header
|
from email.header import Header, make_header
|
||||||
|
|
||||||
|
from procat2.settings import EMAIL_HOST, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -89,9 +91,9 @@ def send(frm, subj, msg):
|
|||||||
|
|
||||||
log.info(f'sending email to "{frm}": {subj}')
|
log.info(f'sending email to "{frm}": {subj}')
|
||||||
|
|
||||||
with smtplib.SMTP('mail.mk.int') as s:
|
with smtplib.SMTP(EMAIL_HOST) as s:
|
||||||
s.starttls()
|
s.starttls()
|
||||||
s.login('remotevm', '5gW311IOs')
|
s.login(EMAIL_HOST_USER, EMAIL_HOST_PASSWORD)
|
||||||
s.send_message(msg)
|
s.send_message(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user