停止Django发票中的重复邮件

停止Django发票中的重复邮件,django,python-2.7,invoice,Django,Python 2.7,Invoice,我正在使用django发票服务向在我的应用程序上进行交易的客户发送邮件。我的代码包含以下行 from django.core.mail.message import EmailMultiAlternatives from django.template.loader import render_to_string from email.MIMEImage import MIMEImage def send_mail(html_content): email = EmailMultiAl

我正在使用django发票服务向在我的应用程序上进行交易的客户发送邮件。我的代码包含以下行

from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import render_to_string
from email.MIMEImage import MIMEImage

def send_mail(html_content):
    email = EmailMultiAlternatives("Invoice Details",text_content,to=[xxxx,xxxx])
    email.attach_alternative(html_content, 'text/html')
    email.send()

但每当我向客户发送邮件时,他们都会收到5到6封内容相同的重复邮件。如何停止django invoice中的这些重复邮件?

用这么多信息调试是不可能的。如何调用
send\u mail
方法?你的日志怎么说?是否所有的电子邮件都有相同的时间戳等…我只是传递一个html呈现的变量来发送邮件。在日志中,只有一个日志正在记录,所有邮件都包含相同的timestimp。Selcuk要求的是显示调用send_mail的代码。使用如此多的信息调试此代码是不可能的。如何调用
send\u mail
方法?你的日志怎么说?是否所有的电子邮件都有相同的时间戳等…我只是传递一个html呈现的变量来发送邮件。在日志中,只有一个日志在记录,所有邮件都包含相同的timestimp。Selcuk要求的是显示调用send_mail的代码。