Forum Discussion
fayrehouse
13 years agoFrequent Contributor
Hi All...
So I've gotten a lot closer:
var myExchange = dotNET.Microsoft_Exchange_WebServices_Data.ExchangeService.zctor_3(dotNET.Microsoft_Exchange_WebServices_Data.ExchangeVersion.Exchange2007_SP1);
var myCredentials = dotNET.Microsoft_Exchange_WebServices_Data.ExchangeCredentials();
var MyInboxId = dotNET.Microsoft_Exchange_WebServices_Data.FolderId.zctor("Inbox");
myExchange.UseDefaultCredentials = true;
myExchange.AutodiscoverUrl("me@mydomain.com");
var MyPropSet = dotNET.Microsoft_Exchange_WebServices_Data.PropertySet.zctor_4(dotNET.Microsoft_Exchange_WebServices_Data.BasePropertySet.FirstClassProperties);
MyPropSet.RequestedBodyType = dotNET.Microsoft_Exchange_WebServices_Data.BodyType.Text;
HOWEVER... Sometimes I have to work remotely, via VPN. As I discovered today, in this case, the AutodiscoverURL above generates an error: "Autodsciver blocked a potentially insecure redirection to <<<autodiscover.xml path>>> . To allow Autodiscover to follow the rediection use the AutodiscoverURL(string, AutodiscoverRedirectionUrlValidationCallback) overload.
So I did some googling, but cannot work out the 2nd parameter for:
myExchange.AutodiscoverUrl("me@mydomain.com", ????SOMETHINGHERE????);
Can anyone advise?
So I've gotten a lot closer:
var myExchange = dotNET.Microsoft_Exchange_WebServices_Data.ExchangeService.zctor_3(dotNET.Microsoft_Exchange_WebServices_Data.ExchangeVersion.Exchange2007_SP1);
var myCredentials = dotNET.Microsoft_Exchange_WebServices_Data.ExchangeCredentials();
var MyInboxId = dotNET.Microsoft_Exchange_WebServices_Data.FolderId.zctor("Inbox");
myExchange.UseDefaultCredentials = true;
myExchange.AutodiscoverUrl("me@mydomain.com");
var MyPropSet = dotNET.Microsoft_Exchange_WebServices_Data.PropertySet.zctor_4(dotNET.Microsoft_Exchange_WebServices_Data.BasePropertySet.FirstClassProperties);
MyPropSet.RequestedBodyType = dotNET.Microsoft_Exchange_WebServices_Data.BodyType.Text;
HOWEVER... Sometimes I have to work remotely, via VPN. As I discovered today, in this case, the AutodiscoverURL above generates an error: "Autodsciver blocked a potentially insecure redirection to <<<autodiscover.xml path>>> . To allow Autodiscover to follow the rediection use the AutodiscoverURL(string, AutodiscoverRedirectionUrlValidationCallback) overload.
So I did some googling, but cannot work out the 2nd parameter for:
myExchange.AutodiscoverUrl("me@mydomain.com", ????SOMETHINGHERE????);
Can anyone advise?