我正在使用SES和Django向多个收件人发送电子邮件。
第一个接收器正确接收它,而不是其他接收器。我试图改变接收器的顺序,它总是收到它的第一封电子邮件。我使用的代码与我没有任何问题的另一个项目相同...因此我怀疑亚马逊存在问题,但从亚马逊控制台发送确实可以正常工作。
当检查第一封电子邮件收到的电子邮件时,我可以看到它应该发送到正确的广告(在到字段中)。
普通收到的电子邮件是这样的(我删除了IP和ID,并用email-number@gmail.com替换了电子邮件):
Delivered-To: EMAIL-1@gmail.com
Received: by ... with SMTP id nXXX;
Wed, 10 Apr 2013 18:02:18 -0700 (PDT)
X-Received: by ... with SMTP id XXX;
Wed, 10 Apr 2013 18:02:17 -0700 (PDT)
Return-Path: <XXX-000000@amazonses.com>
Received: from a8-50.smtp-out.amazonses.com (a8-50.smtp-out.amazonses.com. [...])
by mx.google.com with ESMTP id XXX;
Wed, 10 Apr 2013 18:02:17 -0700 (PDT)
Received-SPF: pass (google.com: domain of XXX@amazonses.com designates ... as permitted sender) client-ip=...;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of XXX@amazonses.com designates ... as permitted sender) smtp.mail=XXX@amazonses.com
Return-Path: XXX@amazonses.com
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Website Enquiry
From: noreply@mydomain.com.au
To: EMAIL1@gmail.com, EMAIL2gmail.com
Date: Thu, 11 Apr 2013 01:02:16 +0000
Message-ID: <XXX@email.amazonses.com>
Reply-To: test@gmail.com
X-SES-Outgoing: 54.240.8.50
Hello,
you have received a message from XXX:
Name: francois
Email: test@gmail.com
test 55
如前所述,如果我反向:EMAIL2 @ gmail.com,EMAIL1gmail.com。 EMAIL1收到消息,而不是EMAIL2@gmail.com。
Django代码非常基础,只是使用它:
self.send_email(
content=self.get_contact_email_content(contact),
subject='Website Enquiry',
to=['EMAIL1@gmail.com', 'EMAIL2@gmail.com'],
reply_to=contact.email_address
)
相同的行为生活和开发。
我很无能。
答案 0 :(得分:0)
发现它,我在做:
to=['EMAIL1@gmail.com, EMAIL2@gmail.com']
而不是:
to=['EMAIL1@gmail.com', 'EMAIL2@gmail.com']