【发布时间】:2019-10-20 03:00:31
【问题描述】:
发送的每封邮件都应密件抄送至第二个电子邮件地址。
我发现 VBA 代码示例如下:
Private Sub Application_ItemSend(ByVal Item As Object, _
Cancel As Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
On Error Resume Next
' #### USER OPTIONS ####
' address for Bcc -- must be SMTP address or resolvable
' to a name in the address book
strBcc = "someone@somewhere.dom"
Set objRecip = Item.Recipients.Add(strBcc)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = "Could not resolve the Bcc recipient. " & _
"Do you want still to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Could Not Resolve Bcc Recipient")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Nothing
End Sub
这行得通如果我将代码添加到 Outlook。
由于我想在 Active Directory 环境中使用它,我想通过 GPO 设置来实现。
我安装了 Office 2016 ADML/ADMX 模板文件,但没有找到为每封发送的邮件配置自动密件抄送的选项。
我找到Active Directory Outlook Signature – VBScript 设置电子邮件签名并认为这可能会成功。
是否可以(我不是 VBS 专家)编写一个在用户登录时运行的脚本,为每封发送的邮件添加密件抄送?
【问题讨论】: