如何在消息窗口中打开邮件时更改发件人名称 [英] How to change sender name while opening mail in message window

查看:114
本文介绍了如何在消息窗口中打开邮件时更改发件人名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI全部,

我有一个要求,当在框中打开邮件时,我想在邮件窗口中显示不同的发件人邮件/名称。 

I have one requirement where while opening the mail from in box item , I would like to display different sender mail / name in message window. 

我已经处理了MailItem的Open事件。在这里,我尝试使用属性MailItem.Sender.Address,MailItem.Sender.Name和MailItem.SendUsingAccount,但没有任何工作。有关详细信息,我附上了截图。我想将
地址从libdarkclient@gmail.com更改为xyz@abc.com。

I have handled Open event of MailItem. Here, I have tried with properties MailItem.Sender.Address, MailItem.Sender.Name and MailItem.SendUsingAccount, but nothing is working. For your further information, I have attached screenshot. I would like to change address from libdarkclient@gmail.com to xyz@abc.com.

请帮忙。

谢谢

Devendra

Devendra

推荐答案

首先,在Outlook中临时更改任何内容并不能真正起作用 - 无论你做什么,它都能帮到你。请尽快进行一次修改,然后在Outlook打开之前执行此操作(或者可能看不到更改)。

Firstly, temporary changing anything in Outlook does not really work - it will get you no matter what you do. Do your modifications once as soon as you can and do that before Outlook opens it (or it might not see the changes).

要更改发件人,您需要更改十几个或所以PR_SENDER_xyz和PR_SENT_REPRSENTING_xyz MAPI属性(看一下带有
的消息 OutlookSpy - 单击IMessage按钮)。请注意,Outlook对象模型(作为大哥)不允许您设置这些属性。您需要使用扩展MAPI(C ++或Delphi)或
兑换(任何语言)来执行此操作。下面的示例脚本重置Outlook中当前所选邮件的发件人(如果单击"脚本"按钮并粘贴
脚本,则可以从OutlookSpy运行它):

To change the sender, you will need to change a dozen or so PR_SENDER_xyz and PR_SENT_REPRSENTING_xyz MAPI properties (take a look at a message with OutlookSpy - click IMessage button). Note that the Outlook Object Model (being the big brother) won't let you set these properties. You will need Extended MAPI (C++ or Delphi) or Redemption (any language) to do that. The sample script below resets the sender of the currently selected message in Outlook (you can run it from OutlookSpy if you click the Script button and paste the script):

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
strEntryID = Session.AddressBook.CreateOneOffEntryID("Fake User", "SMTP", "someuser@fake.domain.com", false, true)
set addressEntry = Session.AddressBook.GetAddressEntryFromID(strEntryID)

set Msg = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID)

Msg.Sender = addressEntry
Msg.SentOnBehalfOf = addressEntry
Msg.Save





这篇关于如何在消息窗口中打开邮件时更改发件人名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆