完成项目信息管理的迁移
This commit is contained in:
@ -15,7 +15,6 @@ from typing import List
|
||||
from redis.asyncio import Redis
|
||||
|
||||
from core.exception import CustomException
|
||||
from utils.cache import Cache
|
||||
|
||||
|
||||
class EmailSender:
|
||||
@ -32,7 +31,7 @@ class EmailSender:
|
||||
"""
|
||||
获取配置信息
|
||||
"""
|
||||
web_email = await Cache(self.rd).get_tab_name("web_email", retry)
|
||||
web_email = []
|
||||
self.email = web_email.get("email_access")
|
||||
self.password = web_email.get("email_password")
|
||||
self.smtp_server = web_email.get("email_server")
|
||||
@ -84,10 +83,3 @@ class EmailSender:
|
||||
print('邮件发送失败!错误信息:', e)
|
||||
return False
|
||||
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# sender = EmailSender()
|
||||
# to_emails = ['ktianc2001@163.com', '2445667550@qq.com']
|
||||
# subject = 'Test email'
|
||||
# body = 'This is a test email'
|
||||
# sender.send_email(to_emails, subject, body)
|
||||
|
Reference in New Issue
Block a user