Link to home
Create AccountLog in
Avatar of Banksr
Banksr

asked on

Auto BCC self on e-mails sent outside the domain

Good morning,

I work in applications support at a law firm, and we're on Exchange 2010 using Outlook 2010.  An attorney called our Help Desk with a request we've never gotten before.  He'd like to automatically BCC himself on all e-mails he sends outside the domain.  I believe I found how he can be auto BCC'd on all e-mails he sends regardless of recipient (using VB), but that extra criteria of outside the domain is throwing me for loop.  Is there any way to do this without purchasing a third-party add-in?  Any other suggestions?

Thanks!
Avatar of Manpreet SIngh Khatra
Manpreet SIngh Khatra
Flag of India image

You can do it using Transport rule but for one user havent checked that .....

- Rancy
ASKER CERTIFIED SOLUTION
Avatar of Amit
Amit
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Hi, Banksr.

Yes, that's possible.  It's really unnecessary since a copy will already be in his/her sent items, but it is doable.  Something like this.  This code checks the address of each recipient on a message.  If the address is an SMTP address and the domain does not match your company's domain, then it adds a BCC to the person sending the message.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    'On the next line change the domain to your email domain
    Const MY_DOMAIN = "company.com"
    Dim olkRcp As Outlook.RECIPIENT
    If Item.Class = olMail Then
        For Each olkRcp In Item.Recipients
            If olkRcp.AddressEntry.Type = "SMTP" Then
                If Mid(olkRcp.Address, InStr(1, olkRcp.Address, "@") + 1) <> MY_DOMAIN Then
                    Item.BCC = Session.CurrentUser.AddressEntry.Address
                    Item.Save
                    Exit For
                End If
            End If
        Next
        Cancel = True
    End If
End Sub

Open in new window

Avatar of Banksr
Banksr

ASKER

Thanks for the replies.  It turns out the attorney is completely okay (actually prefers) to be BCC'd on all of his messages, whether sent internal or external.  I agree this is completely unnecessary since the messages are in Sent Items, but the attorneys are particular about how they work and we try to accommodate all requests. :-)  So the link posted by amitkulshrestha works perfectly in this case (which is what I found on my own originally).  It doesn't necessarily work for the original post of only BCC'ing when sent outside the domain, though. I tried the code supplied by BlueDevilFan but it didn't work.  I don't think because the code is wrong, though.  I think when we send e-mails internally, the address used by Exchange is the X400 address instead of SMTP.

Thanks again!
Banksr,

Just a couple of thoughts in answer to your comments.  Outlook only uses X400 addressing within your email domain.  Messages going outside of the domain use SMTP.  If you edited the code per the comment I included, then it should work.  I tested the code before posting and it worked properly in my domain.