Hello,
I have a requirement to unread email from outlook365 using C#. For this, i am using Exchange web service (EWS). When I read emails, i am getting an error in the below line.(highlighted as bold)
foreach(EmaiMessage email in _service.FindItems(WellKnownFolderName.Inbox, new ItemView(100)))
{
}
Error : foreach statement cannot operate on variable of type 'Task
DId i do anything wrong? Please suggest me.
Thanks!

Ashok ShanmugavelPosted Mar 30, 2022, 9:21 AM
Microsoft.Exchange.WebServices.NETStandard, rather thanMicrosoft.Exchange.WebServicesby Microsoft;Sachin SinghPosted Mar 30, 2022, 7:45 AM