4
A
回答
2
您可能會想要使用WebDAV。下面是關於這個問題
而且a good article,這裏是您使用的Exchange Server版本上Exchange Store
2
MSDN的參考?如果是2007年,則可以使用web service API。 FindItem方法將允許您訪問特定文件夾中的項目。
0
再或者,如果它的2007,您可以使用PowerShell,在.NET應用程序
0
託管請訪問http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/managing-emails-on-exchange-server.html,如果你有興趣使用第三方庫。 Aspose.Network支持從Exchange Server收件箱訪問電子郵件並以eml或msg格式保存到文件。
0
我已經在C#中使用Exchange Server 2010和Windows Service完成了此操作。我從收件箱中檢索郵件,訪問郵件數據,編輯電子郵件的主題(當前硬編碼),並將其從收件箱移至另一個文件夾Saved。我將結果顯示在控制檯應用程序中進行測試,直到需要部署爲止。爲了使它每x分鐘檢查一次,將一個exe任務/作業添加到Windows計劃任務。這裏是代碼:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Exchange101;
using Microsoft.Exchange.WebServices.Data;
namespace Exchange101
{
class Notifications
{
static ExchangeService service = Service.ConnectToService(UserDataFromConsole.GetUserData(), new TraceListener());
static void Main(string[] args)
{
//SetStreamingNotifications(service);
RecieveMails(service);
Console.WriteLine("\r\n");
Console.WriteLine("Press or select Enter...");
Console.Read();
}
static void RecieveMails(ExchangeService service)
{
// Create a view with a page size of 100.
ItemView view = new ItemView(10);
// Indicate that the base property will be the item identifier
view.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
view.PropertySet.Add(ItemSchema.IsAssociated);
// Set the traversal to associated. (Shallow is the default option; other options are Associated and SoftDeleted.)
view.Traversal = ItemTraversal.Associated;
// Send the request to search the Inbox.
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, view);
// Output a list of the item classes for the associated items
foreach (Item item in findResults)
{
Console.WriteLine(item.ItemClass);
}
findResults = service.FindItems(
WellKnownFolderName.Inbox,
new ItemView(10)); //10 is the number of mails to fetch
foreach (Item item in findResults.Items)
{
//this needs to be here to recieve the message body
MessageBody messageBody = new Microsoft.Exchange.WebServices.Data.MessageBody();
List<Item> items = new List<Item>();
if (findResults.Items.Count > 0) // Prevent the exception
{
foreach (Item item2 in findResults)
{
items.Add(item2);
}
}
service.LoadPropertiesForItems(items, PropertySet.FirstClassProperties);
messageBody = item.Body.ToString();
Console.WriteLine("==========================================================================");
Console.WriteLine("IsNew: " + item.IsNew);
Console.WriteLine("To: " + item.DisplayTo);
Console.WriteLine("Subject: " + item.Subject);
Console.WriteLine("Message Body: " + item.Body.ToString());
Console.WriteLine("Date & Time Received: " + item.DateTimeReceived);
Console.WriteLine("HasAttachments: " + item.HasAttachments);
//this is just what I have to do later
//CreateNewWorkflowFromEmail();
//if (WorkflowWasCreated) then move email to saved folder
//here I change the subject and move the mail to my custom folder "Saved"
Folder rootfolder = Folder.Bind(service, WellKnownFolderName.MsgFolderRoot);
rootfolder.Load();
foreach (Folder folder in rootfolder.FindFolders(new FolderView(100)))
{
// This IF limits what folder the program will seek
if (folder.DisplayName == "Saved")
{
var fid = folder.Id;
//Console.WriteLine(fid);
item.Load();
item.Subject = ("WF1234567 - " + item.Subject);
item.Update(ConflictResolutionMode.AlwaysOverwrite);
item.Move(fid);
}
}
}
}
相關問題
- 1. 使用WebDAV訪問Exchange 2003收件箱
- 2. 從Exchange服務器
- 3. 如何使用Exchange Web服務從Exchange Server 2007獲取所有未讀郵件?
- 4. PHP服務器發送的事件 - 消息發送方和收件箱
- 5. 使用Windows服務接收MSMQ消息
- 6. 從Exchange服務器(ews)獲取日曆事件?
- 7. 獲取當前Exchange服務器
- 8. Exchange服務器2010上的郵箱統計信息
- 9. 使用沒有Powershell的C#獲取Exchange郵箱信息
- 10. 在.NET中獲取用戶的Exchange服務器和電子郵件地址
- 11. 使用SNMP獲取服務器信息
- 12. 使用javascript獲取服務器信息
- 13. 服務器沒有收到消息 - Java
- 14. 服務器沒有收到消息
- 15. Java Socket服務器不接收消息?
- 16. 氛圍:服務器接收其消息
- 17. 服務器沒有收到消息
- 18. 使用openfire服務器獲取離線消息的問題
- 19. 從Windows Web服務獲取Linux服務器硬件信息
- 20. 在C#中遠程Exchange 2010服務器上創建Exchange郵箱#
- 21. 將Exchange郵箱2007移動到另一個Exchange服務器
- 22. 從Biztalk中的Exchange服務器接收電子郵件(無POP3)
- 23. 如何獲取消息從服務器發送到Android
- 24. 從POP或IMAP服務器獲取消息
- 25. 從Biztalk的Exchange服務器接收電子郵件,使用POP3或IMAP
- 26. 獲取服務器信息
- 27. Java - 將消息添加到收件箱
- 28. 發送回覆收件箱消息?
- 29. Android中的收件箱消息
- 30. Facebook風格的消息收件箱
你給的鏈接doens't存在。我似乎無法在其他地方找到它。它可以中止嗎? – 2012-04-26 18:57:37