Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public ExchangeRepository()
{
serviceInstance = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
//Provide the account user credentials
serviceInstance.Credentials = new WebCredentials(ConfigurationManager.AppSettings["User"].ToString(),
ConfigurationManager.AppSettings["Password"].ToString(),
ConfigurationManager.AppSettings["Domain"].ToString());
try
{
// Use Autodiscover to set the URL endpoint.
serviceInstance.AutodiscoverUrl(ConfigurationManager.AppSettings["MailBox"].ToString());
}
catch (Exception ex)
{
serviceInstance = null;
ExceptionMessage = ex.Message;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.