Ok, check this..
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim recips As Outlook.Recipients
Dim recip As Outlook.Recipient
Dim pa As Outlook.PropertyAccessor
Dim prompt As String
Dim strMsg As String, strMsg2 As String
Dim domain As String
Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
Set recips = Item.Recipients
For Each recip In recips
Set pa = recip.PropertyAccessor
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@in.Arvind.com") = 0 Then
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@uk.Arvind.com") = 0 Then
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@ie.Arvind.com") = 0 Then
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@Arvind.ie") = 0 Then
strMsg = strMsg & " " & pa.GetProperty(PR_SMTP_ADDRESS) & vbNewLine
domain = LCase(pa.GetProperty(PR_SMTP_ADDRESS))
domain = Split(domain, "@")(1)
domain = Replace(domain, "." & Right(domain, (Len(domain) - InStrRev(domain, "."))), "")
If InStr(Item.Subject, domain) = 0 Then
strMsg2 = strMsg2 & " " & domain & vbNewLine
End If
End If
End If
End If
End If
Next
If strMsg <> "" Then
prompt = "This email will be sent outside of mydomain.com to:" & vbNewLine & strMsg & "Do you want to proceed?"
If MsgBox(prompt, vbYesNo + vbExclamation + vbMsgBoxSetForeground, "Check Address") = vbNo Then
Cancel = True
Exit Sub
End If
End If
If strMsg2 <> "" Then
prompt = "This email does contain external domain name " & vbNewLine & "Kindly add domain name : " & vbNewLine & strMsg2 & vbNewLine & "in subject line to send this email."
If MsgBox(prompt, vbOKOnly + vbMsgBoxSetForeground, "Check Domain NAme") = vbOK Then
Cancel = True
Exit Sub
End If
End If
End Sub
Cheers!!