Issue to message

Peter_1985 2,866 Reputation points
2021-06-26T23:26:16.453+00:00

Hi,
Last line is in error. How to correct it and have cc list as well?

                                                    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);    
                                                    service.Credentials = new WebCredentials("...[@](/users/na/?userId=06f58d19-7ffe-0003-0000-000000000000).com", "???");    
                                                    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");    
                                                    EmailMessage message = new EmailMessage(service);    
                                                    // Set properties on the email message. message.ToRecipients.Add("test[@](/users/na/?userId=a28c79c1-c609-48db-b55f-1783d1187afb).com");    
                                                    ...    
                                                    message.ToRecipients = Email;    
Exchange | Exchange Server | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. Viorel 125.7K Reputation points
    2021-06-27T07:24:35.797+00:00

    If Email is a string or an EmailAddress object, then try message.ToRecipients.Add(Email) and message.CcRecipients.Add(EMail).

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.