C# 重写Outlook邮件项的ReceivedTime属性
在我的公司,我们使用的电子邮件客户端与Outlook不同。将对话复制到Exchange imap文件夹时,ReceivedTime属性设置为当前日期 是否可以通过编程更改此属性?当前,我得到一个错误,该属性是只读的 我当前的代码:C# 重写Outlook邮件项的ReceivedTime属性,c#,outlook-addin,C#,Outlook Addin,在我的公司,我们使用的电子邮件客户端与Outlook不同。将对话复制到Exchange imap文件夹时,ReceivedTime属性设置为当前日期 是否可以通过编程更改此属性?当前,我得到一个错误,该属性是只读的 我当前的代码: private void ThisAddIn_Startup(object sender, System.EventArgs e) { foreach (Outlook.Folder Map in Application.Session.GetDefault
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
foreach (Outlook.Folder Map in Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Folders)
{
if (Map.Name != "some_name")
continue;
if (MessageBox.Show("mes", "title", MessageBoxButtons.OKCancel) != DialogResult.OK)
break;
foreach (Object Item in Map.Items)
{
try
{
String Message = "";
Outlook.MailItem Mail = (Outlook.MailItem)Item;
Message += "Sent by: \"" + Mail.SenderName + "\" \n";
Message += "Sent on: " + Mail.SentOn.ToString() + "\n";
Message += "Received on: " + Mail.ReceivedTime.ToString();
MessageBox.Show(Message);
Mail.ReceivedTime = Mail.SentOn;
//Property or indexer 'Microsoft.Office.Interop.Outlook._MailItem.ReceivedTime' cannot be assigned to: it is read only
}
catch (Exception Exception)
{
}
}
}
}
我们通过购买一个将所有邮件从一个电子邮件系统迁移到另一个电子邮件系统的程序来解决这个问题。这叫做跨地带迁移()。该程序读取您的所有电子邮件,然后将它们写回新系统 希望有帮助