相关疑难解决方法(0)

如何使用django发送异步电子邮件

这是我的代码:

class EmailThread(threading.Thread):
    def __init__(self, subject, html_content, recipient_list):
        self.subject = subject
        self.recipient_list = recipient_list
        self.html_content = html_content
        threading.Thread.__init__(self)

    def run (self):
        msg = EmailMultiAlternatives(self.subject, self.html_content, EMAIL_HOST_USER, self.recipient_list)
        #if self.html_content:
        msg.attach_alternative(True, "text/html")
        msg.send()

def send_mail(subject, html_content, recipient_list):
    EmailThread(subject, html_content, recipient_list).start()
Run Code Online (Sandbox Code Playgroud)

它不发送电子邮件.我能做什么?

python email django asynchronous

17
推荐指数
2
解决办法
1万
查看次数

标签 统计

asynchronous ×1

django ×1

email ×1

python ×1