How to send multiple messages to mandrill


April 2019


449 time


I have around 1000 unique mails with unique content. I want to bulk send them to mandril i.e. I dont want to make individual network calls for every message I am sending. The following document shows the api. But it does not define what I want to.

What I want

mandrill_client = mandrill.Mandrill('YOUR_API_KEY')
    messages ={ message1, message2 ....}

result = mandrill_client.messages.send(messages=messages, async=True, ip_pool='Main Pool', send_at='example send_at')

I could not find the above. But this is what I want.

1 answers


Try this

 message = {
      #other details
     'from_email': '[email protected]',
     'from_name': 'Example Name',
     'to': [{'email': '[email protected]',
             'name': 'Recipient Name',
             'type': 'to'},2nd reciepient,....],
result = mandrill_client.messages.send(messages=messages, async=True)