如何使用Mailgun API将电子邮件发送到邮件列表的所有成员

问题描述 投票:0回答:1

我不完全了解mailgun API逻辑。这是我的问题

我想将电子邮件发送到我的邮件列表(即[email protected])。但是,如果我通过以下代码使用API​​:

def send_simple_message(subject, message):
    return requests.post(
        "https://api.eu.mailgun.net/v3/mg.mydomain.com/messages",
        auth=("api", "****-*****-****"),
        data={"from": "[email protected]",
              "to": ["[email protected]"],
              "subject": subject,
              "text": message})

消息未传递到邮件列表的所有订阅者。如果在"to": ["[email protected]", "[email protected]", "[email protected]"]中设置了我所有用户的列表,他们将收到电子邮件,但不会从邮件中接收,因此可以看到彼此的电子邮件地址。

python email mailgun
1个回答
0
投票

GiovaniSalazar的建议,问题确实在邮件列表中。该代码是正确的,但是您需要添加发件人的权限,以发送到mailgun邮件列表仪表板中的邮件列表。

© www.soinside.com 2019 - 2024. All rights reserved.