Guest User

Untitled

a guest
Mar 21st, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  2.  
  3. On Error Resume Next
  4. ' use lower case for the address
  5. ' LCase converts all addresses in the To field to lower case
  6. If StrComp((Item.SenderEmailAddress), "bad.email@gmail.com") Then
  7. Exit Sub
  8. End If
  9.  
  10. Prompt$ = "You sending this from " & Item.SenderEmailAddress & ". Are you sure you want to send it?"
  11. If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
  12. Cancel = True
  13. End If
  14.  
  15. End Sub
  16.  
  17. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  18. On Error Resume Next
  19. Select Case LCase(Item.To)
  20. Case "alias@domain.com", "alias2@domain3.com", "alias3@domain3.com"
  21. Item.Send
  22. Case Else
  23. Prompt$ = "You are not sending this to " & Item.To & ". Are you sure you want to send the Mail?"
  24. If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
  25. Cancel = True
  26. End If
  27.  
  28. End Select
  29.  
  30. End Sub
Add Comment
Please, Sign In to add comment