I’m trying to do something that should be very simple, create a list of screenshot paths and add to it for each exception, then use the collection for attachment to Send SMTP Mail Message.
If I go to Send SMTP Mail Message and CTRL+K to create the variable it creates it as IEnumerable<String> but then the Append Item to List and Append Items to Collection activities don’t accept that datatype.
An ICollection is an IEnumerable, but can have items added, an IList inherits ICollection so is both a ICollection and an IEnumerable.
Make your variable into an List and the SMTP should accept it. If it says it wants an IEnumerable but wont accept a List<String then something weird is going on with the compiler but that can be fixed with a cast.
Of course you can add things to a variable that is IEnumerable datatype. It’s literally the datatype the Send SMTP Mail Message activity creates for you. The point is all these activities are using different types of collections, so they won’t work together.
I’m not sure what you are complaining about regarding the IEnumerable being the data type for the SMTP…? Its absolutely the correct one, it being an array, or List or Collection would be annoying because it would limit you to that data type.
Because its an IEnumerable, which is an interface that Array, List and Collection all inherit it means you can use all of those data types.
Sorry Paul, but if you want the data type for the SMTP activity to be changed from an IEnumerable then I don’t understand why. I have explained clearly why it is the correct data type.
Its important to counter point suggestions made like this as it can be things that lead to a worse state in the platform. Respectfully if you want to participate in community forums then you must accept other community members disagreeing with you.