verify contact before sending

Status
Not open for further replies.

dawondr

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Hi all, I'm really hoping someone can help me. I have a couple of people that I contact that have the same first names. When I go to the "TO" line and start typing I sometimes will click the wrong name. As an example I have a man named Ron that is in my company and I also have a customer named Ron who is in my personal contacts. They do not have the same last name but when multitasking (read as not paying attention) I have sent and internal e-mail to the external client.

Is there a macro or a rule or something I can set that says if I am sending an e-mail to this person some kind of a warning or verification screen can pop? "u r sending this to Ron Jones, did you mean Smith"? Or any type of an added step to make sure I do not make that mistake again? There are only 2 duplicate names. Ron and Lawrence. One of each is in my corp contact gallery and the other one of each is in my personal contacts list if that helps to "set the trap".

I would like to think after getting burned I would remember but sad to say it has happened more than once so slowing down, paying more attention will not work. Nor will setting all messages to go out after a X minute delay because if I didnt catch it when writting it I'm not going to realize it 5 or 10 minutes later.

By the way, I am using Outlook 2007 if that matters...

Anything anyone can suggest to help me would really be appriciated.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You can use a macro to check the email address and ask - i use a similar one to make sure i use the correct email account when i send mail to a private mailing list where only one of my addresses is approved.

See http://www.slipstick.com/how-to-outlook/prevent-sending-messages-to-wrong-email-address/ for a code sample. I'd probably use this for the two addresses. if you have more than 2 to check, a case statement would be more efficient.

If InStr(LCase(Item.To), "bad@address.com") or InStr(LCase(Item.To), "otherbad@address.com") Then

There is an example on that page with a case statement, you'll want to switch the item.send line with the prompt, if, and end if lines.
 

dawondr

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
You can use a macro to check the email address and ask - i use a similar one to make sure i use the correct email account when i send mail to a private mailing list where only one of my addresses is approved.

See http://www.slipstick.com/how-to-outlook/prevent-sending-messages-to-wrong-email-address/ for a code sample. I'd probably use this for the two addresses. if you have more than 2 to check, a case statement would be more efficient.

If InStr(LCase(Item.To), "bad@address.com") or InStr(LCase(Item.To), "otherbad@address.com") Then

There is an example on that page with a case statement, you'll want to switch the item.send line with the prompt, if, and end if lines.

Thank you, one last question please, I believe the difference between the "check Messages you send" and the "Check addresses in the To, CC, or BCC field using the Recipient Collection" is just that, the first looks only at the TO line while the second would also monitor the CC line as well as the TO line correct? I'm sure that is the difference but I just want to make sure please.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Yes, the one with the To line won't check the other fields. The part that checks the recipients can be added to the macro that uses Case.
 

dawondr

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Great, thank you very much. I hope you have a great weekend.

Dave
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Actually, because the recipient collection checks each address separately, you don't need the instr part, just lcase (just in case an address uses mixed case)

If LCase(recip) ="bad@address.com" Then

or replace that line with these two

Select Case LCase(recip)
Case "alias@domain.com", "alias2@domain3.com", "alias3@domain3.com"
 

dawondr

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Hi Diane, Happy Saturday. I'm sorry to bother you but I can not get this to work. I tried entering my e-mail as a test and was able to send one to myself with no verification popping up. This is exactly what I have in my VBA windoe with the exception of my actual e-mail address. Am I missing something? This is Outlook 2007

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim Recipients As Outlook.Recipients
Dim recip As Outlook.Recipient
Dim i
Dim prompt As String


On Error Resume Next
' use lower case for the address
' LCase converts all addresses in the To field to lower case
Set Recipients = Item.Recipients
For i = Recipients.Count To 1 Step -1
Set recip = Recipients.Item(i)

If LCase(recip) = "john.smith@yahoo.com" Then
prompt$ = "You sending this to bad@address.com. Are you sure you want to send it?"
If MsgBox(prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
Cancel = True
End If
End If

Next i


End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It works here. I use the code to popup a message when i send a message to one address so i can confirm I'm using the correct account - only difference is my prompt:

prompt$ = "You sending this to the list. Are you sure you want to send it from " & Item.SendUsingAccount

- - - Updated - - -

Is your macro security set to allow macros? That's a typical reason why macros don't work.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C 0x800CC0D "Can not find the email server. Verify the server information in your account properties" Using Outlook 4
A There is an error synchronizing your mail account. Please verify your account is configured correctl Using Outlook 2
A Outlook cannot log on. Verify you are connected to the internet & are using the proper server & mail Using Outlook 1
J There is an error synchronizing your mail account. Please verify you account is configured correctly Using Outlook 5
D Cannot verify or add the calendar to Outlook Using Outlook 6
R Time for another article on contact cards? Using Outlook 0
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
M vCard does not have user-defined fields from my custom contact form (365) Using Outlook 1
C Copy Outlook contact field value to another field Outlook VBA and Custom Forms 1
W Remove specific contacts from contact list Outlook VBA and Custom Forms 3
GregS 2016 Contact List being managed by Outlook.com? Using Outlook 1
F Copy and replace not update contact in another pst Using Outlook 0
A Sending contact vcards sends older version instead of updated version Using Outlook 4
T Outlook 2010 Correct way to map multiple contact fields Using Outlook 4
Victor_50 Outlook 2013 Custom Contact Form starts with "E-mail 2" Outlook VBA and Custom Forms 2
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
L dynamic and static dates in Outlook contact "notes" ie. body Using Outlook 2
Randy Redekopp How To Merge Contact Info to Email Custom Form Template Using Outlook 2
L Wierd Office 365 Contact unable to edit body of random contacts Using Outlook 5
M Contact photos are distorted Using Outlook 0
C Outlook Contact Manager - A viable successor? BCM (Business Contact Manager) 7
N Contact display as Using Outlook 2
N contact notepad 'style' getting changed after clicking and running Activities Using Outlook 2
N How to turn off autocorrect in contact notepads Using Outlook 2
S Unable to Edit Contact Information in Certain Contact Folders Using Outlook 3
P Add a contact to the New Task in Outlook 2016 Using Outlook 2
P AGGGGHHHH!!!! - Address Books and Contact Subfolders Using Outlook 5
J Contact Business card view Using Outlook 11
dyny723 Outlook 2016: Code to link a contact to emails received from that contact Outlook VBA and Custom Forms 1
G Mass Updating Contact form used Outlook VBA and Custom Forms 8
witzker Macro to set contact reminder to next day 9:00 Outlook VBA and Custom Forms 45
witzker social connector 2010 does not show all emails to or from contact Using Outlook 3
witzker social connector 2010 does not show all emails to or from contact New Slipstick.com Articles 0
Rupert Dragwater How to import contact list Using Outlook 15
S Display PF contact folder items to select contact to link to appointment Outlook VBA and Custom Forms 1
T One Contact list, two sections of company (none) Using Outlook 2
M regarding legacy contact cards Using Outlook 2
J Backup .OST - Custom Contact Forms, Defined Fields, Notes Using Outlook 1
A remove or turn off outlook.com contact folder from outlook 2016 Using Outlook 4
L OL 2016 contact: is there a way to prevent an admin from mistakenly deleting a contact? Using Outlook 1
P Run Time Error 91 when linking contact to task in VBA Outlook VBA and Custom Forms 1
D Customized Contact Form Losing UDFs. Outlook VBA and Custom Forms 12
C Display Sender As Contact Outlook VBA and Custom Forms 4
R Outlook add-in to create new contact from an email. Using Outlook 0
E Imported Contact Issues Using Outlook 11
K Contact notes field replicating Using Outlook 6
R Custom Contact Form how to update when loaded. Outlook VBA and Custom Forms 6
M VBA to change flag status in outlook contact item Outlook VBA and Custom Forms 3
M Contact group shortcut Using Outlook 3
M adding corresponding contact form data on a mass scale Using Outlook 5

Similar threads

Top