Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  2. Dim objRecip As Recipient
  3.     Dim strMsg As String
  4.     Dim res As Integer
  5.     Dim strBcc As String
  6.     On Error Resume Next
  7.      
  8.     ' #### USER OPTIONS ####
  9.    ' address for Bcc -- must be SMTP address or resolvable
  10.    ' to a name in the address book
  11.    strBcc = "email@yourdomain.com"
  12.      
  13.     Set objRecip = Item.Recipients.Add(strBcc)
  14.     objRecip.Type = olBCC
  15.     If Not objRecip.Resolve Then
  16.         strMsg = "Could not resolve the Bcc recipient. " & _
  17.                  "Do you want still to send the message?"
  18.         res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
  19.                  "Could Not Resolve Bcc Recipient")
  20.         If res = vbNo Then
  21.             Cancel = True
  22.         End If
  23.     End If
  24.      
  25.     Set objRecip = Nothing
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement