![](/img/trans.png)
[英]Excel VBA code to send emails from a specific shared email Account from Outlook not working (.sentonbehalfof)
[英]Sending from a shared mailbox without using sentOnBehalfOf
我目前正在使用outlook.application
从共享邮箱发送邮件。
我需要一种发送这些消息的方法,而我的电子邮件地址不会出现在“发件人”列表中。 它应该只是共享邮箱出现。 目前我正在使用.sentOnBehalfOf
,我还应该使用其他东西吗?
申请代理发送权限。
您应该可以在电子邮件的“发件人”字段中选择共享帐户。
使用.SendUsingAccount在VBA中指定共享帐户。
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
共享帐户可能是2。
With OutMail
.SendUsingAccount = OutApp.Session.Accounts.Item(2)
End With
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.