models.py
class FollowerEmail(models.Model):
report = models.ForeignKey(Report)
email = models.CharField('Email', max_length=100)
ビュー.py
def what(request):
""""""
follower = FollowerEmail.objects.filter(report=report)
list=[]
for email in follower:
list.append(email.email)
""""""""
if 'send_email' in request.POST:
subject, from_email, to = 'Notification',user.email, person.parent_email
html_content = render_to_string('report/print.html',{'person':person,
'report':report,
'list':list,
})
text_content = strip_tags(html_content)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to],bcc=[list], cc=['monKarek@live.com'])
msg.attach_alternative(html_content, "text/html")
msg.send()
上記は電子メールを送信するための私のview.pyです。電子メールは適切に「to」アドレスに送信されます.問題はbccタグにあります.FollowerEmailテーブルから電子メールを取得してリストを作成しています.そのリストをbccとしてbccに渡していますメール ID リストは大きくなり、3 つ以上になります。
リストに 2 つ以上の電子メール ID がある場合、アプリケーションはメールを送信していません。2 つまたは 1 つの場合、アプリケーションはメールを送信しています。何が問題なのか
ありがとう