Block email sender

旧城冷巷雨未停 提交于 2019-12-27 03:56:06

问题


Is there anyway you can create a code, when you click a button (I've already created this) it will take the selected email and block the sender which will delete the email?


回答1:


Outlook Object Model does not expose blocked/safe senders at all. If using Redemption is an option, it exposes RDOJunkEmailOptions object (returned from RDOSession.JunkEmailOptions, RDOAccount.JunkEmailOptions, RDOExchangeMailboxStore.JunkEmailOptions), which allows to add blocked senders using RDOJunkEmailOptions.BlockedSenders.Add.




回答2:


The Outlook object model doesn't provide anything for that. However you can create a VSTO add-in which can handle incoming emails and delete them is the sender belongs to a blocked list. The NewMailEx event of the Application class is fired when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Use this method with caution to minimize the impact on Outlook performance. However, depending on the setup on the client computer, after a new message arrives in the Inbox, processes like spam filtering and client rules that move the new message from the Inbox to another folder can occur asynchronously.

See Walkthrough: Create your first VSTO Add-in for Outlook to get started quickly.



来源:https://stackoverflow.com/questions/50954108/block-email-sender

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!