A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

recipient email address is invalid, but resolved property is true



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 28th 09, 08:36 PM posted to microsoft.public.outlook.program_vba
Mark VII
external usenet poster
 
Posts: 6
Default recipient email address is invalid, but resolved property is true

Greetings --

I'm working on some email automation via VBA. (For a variety of reasons, I
can't use the system address book, and keep the email addresses in an Access
table. Long story.) I want to be able to protect against a fat-fingered
address in the table.

What I have so far creates the MailItem, adds a recipient, then uses the
Resolve method to make sure the email address exists in our system. (We have
Exchange servers.)

What is happening is the resolved property is returning True, even if the
address is invalid.

Here's a code extract:

Dim appOutlook As Outlook.Application
Dim nsNameSpace As Outlook.Namespace
Dim miMailItem As Outlook.MailItem
Dim rcpRecipient As Outlook.Recipient

Set appOutlook = CreateObject("Outlook.application")
Set nsNameSpace = appOutlook.GetNamespace("MAPI")
Set miMailItem = appOutlook.CreateItem(olMailItem)
miMailItem.Subject = "some text"
Set rcpRecipient = miMailItem.Recipients.Add("invalid.email@ourcompan y.com")
If rcpRecipient.Resolved = True Then
'* OK, continue
Else
'* issue error message and abort
End If

The Resolved property always returns True, I can't trap for an invalid email
address. Should I be doing something differently to detect an invalid
address?

Thanks,
Mark
Ads
  #2  
Old May 28th 09, 09:44 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default recipient email address is invalid, but resolved property is true

How could Outlook possibly know if that was an invalid address?

If the format of the email address is correct it will resolve. That doesn't
mean that it's an actual email address that you can send to.

I can resolve but that doesn't mean that address actually
exists anywhere.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mark VII" wrote in message
...
Greetings --

I'm working on some email automation via VBA. (For a variety of reasons,
I
can't use the system address book, and keep the email addresses in an
Access
table. Long story.) I want to be able to protect against a fat-fingered
address in the table.

What I have so far creates the MailItem, adds a recipient, then uses the
Resolve method to make sure the email address exists in our system. (We
have
Exchange servers.)

What is happening is the resolved property is returning True, even if the
address is invalid.

Here's a code extract:

Dim appOutlook As Outlook.Application
Dim nsNameSpace As Outlook.Namespace
Dim miMailItem As Outlook.MailItem
Dim rcpRecipient As Outlook.Recipient

Set appOutlook = CreateObject("Outlook.application")
Set nsNameSpace = appOutlook.GetNamespace("MAPI")
Set miMailItem = appOutlook.CreateItem(olMailItem)
miMailItem.Subject = "some text"
Set rcpRecipient =
miMailItem.Recipients.Add("invalid.email@ourcompan y.com")
If rcpRecipient.Resolved = True Then
'* OK, continue
Else
'* issue error message and abort
End If

The Resolved property always returns True, I can't trap for an invalid
email
address. Should I be doing something differently to detect an invalid
address?

Thanks,
Mark


  #3  
Old May 28th 09, 10:05 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default recipient email address is invalid, but resolved property is true

An SMTP address in the format is always a valid email
address to Outlook and will always resolve regardless of whether it exists
in any of the user's address lists.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Mark VII" wrote in message
...
Greetings --

I'm working on some email automation via VBA. (For a variety of reasons,
I
can't use the system address book, and keep the email addresses in an
Access
table. Long story.) I want to be able to protect against a fat-fingered
address in the table.

What I have so far creates the MailItem, adds a recipient, then uses the
Resolve method to make sure the email address exists in our system. (We
have
Exchange servers.)

What is happening is the resolved property is returning True, even if the
address is invalid.

Here's a code extract:

Dim appOutlook As Outlook.Application
Dim nsNameSpace As Outlook.Namespace
Dim miMailItem As Outlook.MailItem
Dim rcpRecipient As Outlook.Recipient

Set appOutlook = CreateObject("Outlook.application")
Set nsNameSpace = appOutlook.GetNamespace("MAPI")
Set miMailItem = appOutlook.CreateItem(olMailItem)
miMailItem.Subject = "some text"
Set rcpRecipient =
miMailItem.Recipients.Add("invalid.email@ourcompan y.com")
If rcpRecipient.Resolved = True Then
'* OK, continue
Else
'* issue error message and abort
End If

The Resolved property always returns True, I can't trap for an invalid
email
address. Should I be doing something differently to detect an invalid
address?

Thanks,
Mark



  #4  
Old May 29th 09, 06:24 PM posted to microsoft.public.outlook.program_vba
Mark VII
external usenet poster
 
Posts: 6
Default recipient email address is invalid, but resolved property is t

Sue and Ken --

Thanks for clarifying. I wasn't sure if an email address in internet format
was actually validated or not.

Mark
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
getting email address of To property in Outlook Inbox and From property in Outlook Outbox Omatase Outlook - General Queries 1 July 19th 07 01:04 PM
Why does the Address property of the Recipient object in the Outlook object model look funny? Omatase Outlook - General Queries 2 July 13th 07 09:09 PM
Invalid recipient?!? TR Young Outlook - General Queries 5 December 1st 06 06:03 PM
Setting Restrict for NoAging property, resolved Greg J Outlook and VBA 1 October 24th 06 05:54 AM
SafeItem.TO property is empty when the recipient is in address Martin Outlook and VBA 0 January 25th 06 11:13 AM


All times are GMT +1. The time now is 02:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.