fix email
This commit is contained in:
@@ -46,6 +46,40 @@ class BaseService:
|
|||||||
support@mermsemr.com
|
support@mermsemr.com
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
html_body = f"""\
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body style="font-size:14px;line-height:1.5;">
|
||||||
|
<table width="550px" border="0" cellpadding="3" cellspacing="3" background-color="#F0F8FF" style="font-size:16px">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center">
|
||||||
|
<img style="width:150px; height:auto;" src="mermsemr.com/images/logo-pink.png" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Hello <b>{firstname}!</b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Password Reset Completed<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
For any support<br>
|
||||||
|
Reach Out<br>
|
||||||
|
support@mermsemr.com<br>
|
||||||
|
https://www.mermsemr.com/
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
"""
|
||||||
|
|
||||||
sender_email = BaseService.SEND_EMAIL_FROM
|
sender_email = BaseService.SEND_EMAIL_FROM
|
||||||
sender_password = BaseService.SEND_EMAIL_PASS
|
sender_password = BaseService.SEND_EMAIL_PASS
|
||||||
receiver_email = signup_email
|
receiver_email = signup_email
|
||||||
@@ -56,7 +90,7 @@ class BaseService:
|
|||||||
msg['Subject'] = subject
|
msg['Subject'] = subject
|
||||||
msg['From'] = sender_email
|
msg['From'] = sender_email
|
||||||
msg['To'] = receiver_email
|
msg['To'] = receiver_email
|
||||||
msg.attach(MIMEText(body, 'plain')) # or 'html' for HTML content
|
msg.attach(MIMEText(html_body, 'html')) # or 'html' for HTML content
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# For Gmail, use 'smtp.gmail.com' and port 587 (TLS) or 465 (SSL)
|
# For Gmail, use 'smtp.gmail.com' and port 587 (TLS) or 465 (SSL)
|
||||||
|
|||||||
Reference in New Issue
Block a user