Microsoft OnlineでExchangeサーバーに接続しようとすると、次のエラーが発生します。基になるXMLにアクセスする方法がわかりませんでした。このエラーは、EWS APIが期待するXML応答ではなく、Exchangeが標準のOWAログインフォームを提供しているだけであるために発生するのではないかと思いました。どうすればこれを確認できますか?
これは私のコードの最後の行にスローされたエラーです:'>'は予期しないトークンです。期待されるトークンは'"'または'''です。7行目、62番目の位置。
これは私のコードです:
Dim ews As New ExchangeService
ews.Credentials = New WebCredentials("mytestmailbox@mydomain.com", "mypassword")
ews.Url = New Uri("https://mysubdomain.microsoftonline.com")
'send a test message
Dim message As New EmailMessage(ews)
message.Subject = "Hello World!"
message.Body = "This is a test message"
message.ToRecipients.Add("some@email.com")
message.SendAndSaveCopy()