0
받은 편지함에서 삭제 된 폴더로 메일을 이동하려고합니다. 그러나 프로그램을 실행할 때 위의 오류 메시지가 나타납니다. 이 문제를 해결하는 데 도움주세요. 다음은 서버가 서버에있는 방법은 귀하의 HTTP 요청 유형과 일치하지 않습니다 제외 할 때이 오류가 그림으로 오는 내 코드원격 서버에서 오류 405 메서드를 반환했습니다.
string mailboxURI = "URL//";
string username = "username";
string password = "Password";
string domain = "domain name";
Console.WriteLine("Connecting to Exchange Server....");
try
{
NetworkCredential credential = new NetworkCredential(username, password, domain);
ExchangeClient client = new ExchangeClient(mailboxURI, credential);
ExchangeMailboxInfo mailboxInfo = client.GetMailboxInfo();
// List all messages from Inbox folder
Console.WriteLine("Listing all messages from Inbox....");
ExchangeMessageInfoCollection msgInfoColl = client.ListMessages(mailboxInfo.InboxUri);
foreach (ExchangeMessageInfo msgInfo in msgInfoColl)
{
// Move message to "Deleted" folder, after processing certain messages
// based on some criteria
if (msgInfo.Date != DateTime.Today)
{
// Move it
client.MoveItems(msgInfo.UniqueUri, client.MailboxInfo.RootUri + "/Deleted/" + msgInfo.Subject);
Console.WriteLine("Message moved...." + msgInfo.Subject);
}
else
{
Console.WriteLine("Not moved:" + msgInfo.Subject);
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error:"+ex.Message);
Console.Read();
}
}
뭔가 UR URL에 문제가 있습니다 – Neel