-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from zq99299/dev
邮件发送默认使用 text 改为 html 发送
- Loading branch information
Showing
5 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,10 @@ | |
|
||
``` | ||
pip install tools-mrcode | ||
``` | ||
``` | ||
|
||
## 更新日志 | ||
|
||
### v0.0.5 | ||
|
||
- 优化:mail_util.send 方法默认由 text 改为 html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unittest | ||
from src.tools_mrcode import mail_util | ||
|
||
|
||
class MailUtilTestCase(unittest.TestCase): | ||
def test_send(self): | ||
smtp_host: str = 'smtp.163.com' | ||
smtp_port: int = 25 | ||
smtp_user: str = 'work_mrcode@163.com' | ||
smtp_pwd: str = 'NLILRISEMYIUVXPH' | ||
sender: str = smtp_user | ||
to: str = '99299684@qq.com' | ||
subject: str = '测试邮件' | ||
body: str = '<p>测试邮件内容</p><h1>测试邮件内容</h1>' | ||
body = (f'店铺 22 </br> ' | ||
f'达人获取页面可能触发了风控,请手动访问该页面,检测并解控 </br> ' | ||
f'当次推送成功达人数量 2 分钟 ') | ||
mail_util.send(smtp_host=smtp_host, smtp_port=smtp_port, smtp_user=smtp_user, smtp_pwd=smtp_pwd, sender=sender, | ||
to=to, | ||
subject=subject, body=body) |