Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
- On Error Resume Next
- ' use lower case for the address
- ' LCase converts all addresses in the To field to lower case
- If StrComp((Item.SenderEmailAddress), "bad.email@gmail.com") Then
- Exit Sub
- End If
- Prompt$ = "You sending this from " & Item.SenderEmailAddress & ". Are you sure you want to send it?"
- If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
- Cancel = True
- End If
- End Sub
- Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
- On Error Resume Next
- Select Case LCase(Item.To)
- Case "alias@domain.com", "alias2@domain3.com", "alias3@domain3.com"
- Item.Send
- Case Else
- Prompt$ = "You are not sending this to " & Item.To & ". Are you sure you want to send the Mail?"
- If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
- Cancel = True
- End If
- End Select
- End Sub
Add Comment
Please, Sign In to add comment