vba 从共享邮箱发送而不使用 sentOnBehalfOf

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18652964/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 23:10:54  来源:igfitidea点击:

Sending from a shared mailbox without using sentOnBehalfOf

vbams-accessoutlook

提问by germantom

I'm currently using outlook.applicationto send mail from a shared mailbox.

我目前正在使用outlook.application从共享邮箱发送邮件。

I need a way to send these messages without my email address appearing on the 'from' list. It should only be the shared mailbox appearing. At the moment i'm using .sentOnBehalfOf, is there something else i should be using?

我需要一种方法来发送这些邮件,而我的电子邮件地址不会出现在“发件人”列表中。它应该只是出现的共享邮箱。目前我正在使用.sentOnBehalfOf,还有什么我应该使用的吗?

回答by niton

Request Send As permission.

请求代理发送权限。

http://social.technet.microsoft.com/Forums/office/en-US/7fd3e945-092a-461b-afa9-a126b8cc3cdd/configure-outlook-to-send-as-permissions

http://social.technet.microsoft.com/Forums/office/en-US/7fd3e945-092a-461b-afa9-a126b8cc3cdd/configure-outlook-to-send-as-permissions

You should be able choose the shared account in the From field of email.

您应该能够在电子邮件的发件人字段中选择共享帐户。

Use .SendUsingAccount to specify the shared account in VBA.

使用 .SendUsingAccount 指定 VBA 中的共享帐户。

http://www.rondebruin.nl/win/s1/outlook/account.htm

http://www.rondebruin.nl/win/s1/outlook/account.htm

Sub Which_Account_Number()
'Don't forget to set a reference to Outlook in the VBA editor
Dim OutApp As Outlook.Application
Dim I As Long

Set OutApp = CreateObject("Outlook.Application")

For I = 1 To OutApp.Session.Accounts.Count
    MsgBox OutApp.Session.Accounts.Item(I) & " : This is account number " & I
Next I
End Sub

The shared account will likely be 2.

共享帐户可能是 2。

With OutMail

    .SendUsingAccount = OutApp.Session.Accounts.Item(2)

End With