Pessoal. bom dia.
Preciso ler um e-amil específico dentro do microsoft exchange server, e baixar os arquivos anexos deste e-mail.
Alguém poderia me dar uma dica onde encontrar ajuda?
obrigado.
O que eu já fiz: Criei o metodo abaixo, mas ocorre exception:
The Autodiscover service couldn't be located.
public static void LerEmail2()
{
ExchangeService serviceInstance;
serviceInstance = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
//Provide the account user name in format vibhu.kuchhal@contoso.com
serviceInstance.TraceEnabled = true;
serviceInstance.UseDefaultCredentials = false;
serviceInstance.EnableScpLookup = false;
serviceInstance.Credentials = new WebCredentials(ConfigurationManager.AppSettings["User"].ToString(), ConfigurationManager.AppSettings["Password"].ToString(), ConfigurationManager.AppSettings["myDomain"].ToString());
try
{
// Use Autodiscover to set the URL endpoint.
// and using a AutodiscoverRedirectionUrlValidationCallback in case of https enabled clod account
serviceInstance.AutodiscoverUrl(ConfigurationManager.AppSettings["MailBox"].ToString(), RedirectionCallback);
}
catch (Exception ex)
{
serviceInstance = null;
//ExceptionMessage = ex.Message;
}
}