How to initialise a MailAddressCollection variable?

email

#1

I am trying to read my company email inbox, and add the senders’ email addresses of all external emails, to a MailAddresCollection variable. When I use the Add To Collection activity, I have configured the following:

  • Item: mail.From
  • Type of argument: Mail.MailAddress

I have also created a new variable of MailAddressCollection type called collectionExternalEmailAddress, and set the Add To Collection activity’s Collection to collectionExternalEmailAddress. However, every time I run the script I get “The property ‘Collection’ of ‘Add to collection’ is not initialized”

How do I initialise a MailAddressCollection variable? Or how can I set the default value for a MailAddressCollection variable?

Thank you!


#2

In assign:
collectionExternalEmailAddress = new MailAddressCollection()
Works fine adding MailAddress objects to it after that.


#3

Thank you so much! Works like a charm :slight_smile:


#4

Hi! I’m having the same issue, but with an ICollection variable. What should I do?