Outlook 自动化 - 更改发件人帐户 [英] Outlook automation - Change Sender Account
问题描述
我正在自动化 Outlook,我需要控制电子邮件似乎来自谁.用户将在 Outlook 中设置两个或多个帐户,我需要能够选择从哪个帐户发送电子邮件.有什么想法吗?
I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas?
需要在 Outlook 2003 及更高版本上支持.我正在使用 Delphi 2006 对此进行编码,但这并不重要.
Needs to be supported on Outlook 2003 and above. I'm using Delphi 2006 to code this, but that doesn't really matter.
推荐答案
一位名叫 Sue Mosher 的人在 microsoft.public.office.developer.outlook.vba.
A person named Sue Mosher wrote up a pretty summary on this issue in microsoft.public.office.developer.outlook.vba.
简而言之,它可以归结为以下任一情况:
In short, it boils down to either of this:
- 使用
MailItem.SentOnBehalfOfName
,它只适用于 Exchange 环境(我想你就是这种情况) - 当用户对另一个 Exchange 邮箱具有发送为"权限时,这很漂亮与切换帐户大致相同. - 使用一个小技巧,包括摆弄
CommandBars
- 使用 Outlook 兑换
- (在 OL2007 中,您将拥有
MailItem.SendUsingAccount
)
- use
MailItem.SentOnBehalfOfName
, which only works in Exchange enviromnents (I suppose that is the case for you) - when the user has "Send As" permissions for the other Exchange mailbox, this is pretty much the same thing as switching accounts. - use a small hack that involves fiddling with the
CommandBars
- use Outlook Redemption
- (in OL2007, you would have
MailItem.SendUsingAccount
)
这篇关于Outlook 自动化 - 更改发件人帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!