I am taking a RPA class on Udemy and one of the exercises is sending emails with attachments. I keep getting errors about Strings not being converted to IEnumerable.
I think it has something to do with the variable type. I reviewed a few threads discussing this same topic. I tried all of their suggestions but none of them worked.
Thank you for the replies, but unfortunately, it still does not work. The full file pathway is stored in CurrentFile.FullName, but when I use the suggested syntax, I still get an error.
Per your guidance, I used attachments.Select(Function(x) LocalResource.FromPath(CurrentFile.FullName). The original syntax you provided was
attachments.Select(Function(x) LocalResource.FromPath(x)…I added the actual pathway in place of the second X in this expression.
Lastly, let’s talk about the variable type for the attachments, because it was not obvious. If you hover over the attachments field at the bottom of the Send Email box, it will tell you that the Type is IEnumerableIResource; however, this does not work. You must use IEnumerableString.