# MS 365 Mail requires "Array of objects" - How?

**URL:** <https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302>\
**Category:** Questions\
**Tags:** microsoft-365, arrays\
**Created:** [February 13, 2025, 12:51am UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302 "2025-02-13T00:51:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Leo](https://community.make.com/u/Leo)\
**Post date:** [February 13, 2025, 12:51am UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/1 "2025-02-13T00:51:51Z")

</div>

Hi, I’m struggling with the Microsoft 365 Mail module. I want to send one mail to multiple recipients.

For that an array is required, so this is my setup:

 ![image 2025-02-12 um 21.40.26](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/8/c/8c3492c8eeb04556cfa0d8174b0f1b9ff8d09962.png)  
 ![image 2025-02-12 um 21.44.19](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/7/77663e31be7a9fb60144df1c36e9750e06f86067.png)

However: I get an error of the mail module saying “Array of objects expected in parameter ‘toRecipients’.”

What exactly is required here? Does someone have an example? Seems like a more complex arrays is required?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![momomomonmon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/momomomonmon/32/59454_2.png) [@momomomonmon](https://community.make.com/u/momomomonmon)\
**Post date:** [February 13, 2025, 2:47am UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/2 "2025-02-13T02:47:40Z")

</div>

@Leo  
Hi, I think the following post is helpful.

> [@Sending email to multiple CC's](https://community.make.com/t/sending-email-to-multiple-ccs/35561/3):
>
> According to the [sendMail endpoint](https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http) on the Microsoft 365 Mail Documentation, toRecipients field accepts an array of collections, each looks like this: { "emailAddress": { "address": "frannis@contoso.com" } } So you’ll need to build the array using an aggregator, so your final structure of the array variable will look like this: "toRecipients": [ { "emailAddress": { "address": "frannis1@contoso.com" } }, { "emailAddress": { "address": "frannis2@contoso.com"…

According to the above post, it appears that the following structure needs to be created.  
It also says that you need to enter the `ToRecipients` in Map.

```auto
"toRecipients": 
[
  {
    "emailAddress": {
      "address": "test1@contoso.com"
    }
  }, 
  {
    "emailAddress": {
      "address": "test2@contoso.com"
    }
  }, 
  {
    "emailAddress": {
      "address": "test3@contoso.com"
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![Leo](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Leo](https://community.make.com/u/Leo)\
**Post date:** [February 13, 2025, 11:27am UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/3 "2025-02-13T11:27:09Z")

</div>

Oh great, that’s a good insight! thanks!

However, now I’m really struggling getting to this format 😕

My approach:  
Array aggreagtor first

 ![image 2025-02-13 um 10.09.21](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/8/d8df37f521e88591602288969d7edb9ebcd63db3.png)

and setting the variable like that:

 ![image 2025-02-13 um 09.02.38](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/f/2fb85422e24575f72bb70e24d0652ca8a70bf796.png)  
However, the result:  
 ![image 2025-02-13 um 09.03.03](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/2/7292435a3d223938ebbebf87c2bf2502cb822bf8.png)

Is it the right approach? any chance for some more help? 🙏

---

<div class="post-metadata">

**Author:** ![Leo](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Leo](https://community.make.com/u/Leo)\
**Post date:** [February 13, 2025, 2:42pm UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/4 "2025-02-13T14:42:44Z")

</div>

My simple but “ugly” solution so far: Switch to the general E-Mail module and login with the MS account.  
There a simple array of mail is good enough for multiple recipients… thanks MS 😅

---

<div class="post-metadata">

**Author:** ![momomomonmon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/momomomonmon/32/59454_2.png) [@momomomonmon](https://community.make.com/u/momomomonmon)\
**Post date:** [February 14, 2025, 2:01pm UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/5 "2025-02-14T14:01:24Z")

</div>

@Leo  
Sorry for the late reply. I also need to apologize for one more thing. There were some errors in the `toRecipients` that I pasted in my first response and I have corrected them.  
The best I can come up with is to create a scenario like the blueprint below.  
[blueprint\_createToRecipientsJson.json](https://community.make.com/uploads/short-url/4aqexLounMLJ1YX0tifDpnkhs4U.json) (17.0 KB)

It is difficult to explain in text only, so I would like you to take a look at the blueprint.  
But for a brief explanation, the values of the Array Aggregator are retrieved one by one in Repeater and aggregated in Text Aggregator.  
Only the last loop of Repeater has a separate branch in Router. I didn’t want to include commas, so I split the branches.  
The final output of blueprint has the following structure.

```auto
  {
    "emailAddress": {
      "address": "test1@contoso.com"
    }
  }, 
  {
    "emailAddress": {
      "address": "test2@contoso.com"
    }
  }, 
  {
    "emailAddress": {
      "address": "test3@contoso.com"
    }
  }

```

I think it would work if you could enter the following into the Outlook module. Replace the `${output}` with the value output by the Text Aggregator.

```auto
"toRecipients":[
  ${output}
]

```

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [February 28, 2025, 10:46pm UTC](https://community.make.com/t/ms-365-mail-requires-array-of-objects-how/69302/6 "2025-02-28T22:46:41Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.


