Merge pull request #244 from clover1420/dev
修复邮箱推送的编码错误,优化邮箱信息的由于背景图片而看不清文字。
This commit is contained in:
commit
f221ae7d58
@ -12,14 +12,15 @@
|
||||
<div class="cover">
|
||||
<!-- 邮箱只解析行内样式 -->
|
||||
<img src="https://iw233.cn/api/Random.php" alt="background" style="width: 100%;
|
||||
filter: brightness(80%)">
|
||||
filter: brightness(50%)">
|
||||
<section style="position: fixed; width: 100%;
|
||||
top: 10%;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
font-weight: 800;">
|
||||
<h2>{title}</h2>
|
||||
<p>{message}</p>
|
||||
<!-- 添加阴影防止背景太鲜艳看不清文字 -->
|
||||
<h2 style="color: #fff;text-shadow:0px 0px 10px #000;">{title}</h2>
|
||||
<p style="color: #fff;text-shadow:0px 0px 10px #000;">{message}</p>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
|
2
push.py
2
push.py
@ -81,7 +81,7 @@ def cqhttp(send_title, push_message):
|
||||
def smtp(send_title, push_message):
|
||||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
with open("assets/email_example.html") as f:
|
||||
with open("assets/email_example.html", encoding="utf-8") as f:
|
||||
EMAIL_TEMPLATE = f.read()
|
||||
message = EMAIL_TEMPLATE.format(title=send_title, message=push_message.replace("\n", "<br/>"))
|
||||
message = MIMEText(message, "html", "utf-8")
|
||||
|
Loading…
Reference in New Issue
Block a user