Issue to message

Peter_1985 2,691 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 Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
562 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 119K 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 Answers by the question author, which helps users to know the answer solved the author's problem.