Verify Outlook Email Names

  • Thread starter Thread starter Norm
  • Start date Start date
N

Norm

I have an application being used in another state, that sends reports and
other forms as an attachment and is used by a lot of different users.

Their internal email is based on user names and the Director of the
department using the program enters the email names into an .ini file so
that all users have the same list to send reports to.

The program loops through this list and adds each name to a variable
AllUsers which is then used as the .To entry.

The problem comes when the program sends the email and one of the names is
wrong. Outlook generates a message that it does not recognize one of the
names and does not send the email, but the user does not know which name is
wrong.

I do not have access to a network or Exchange server here to test on and was
wondering if there is a way to check each name against the server, with out
actually sending individual emails.

Any help would be appreciated.

Thanks,
Norm
 
Yes, you can use the MailItem.Recipients.Add method to add each name to the Recipients collection and return a Recipient, which you can then attempt to resolve with the Recipient.Resolve method. Resolve returns True if the name resolved into an address successfully.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,

Thanks very much for the information. I will try that and see how it works.

It is a little difficult trying to work this out long distance.:-)

Thanks again,
Norm
Yes, you can use the MailItem.Recipients.Add method to add each name to the
Recipients collection and return a Recipient, which you can then attempt to
resolve with the Recipient.Resolve method. Resolve returns True if the name
resolved into an address successfully.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top