Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Determine If Groupwise Email Address Is Incorrect Within Foxpro

Status
Not open for further replies.

lr145

Programmer
May 21, 2008
11
Within a Foxpro 9.0 program I am trying to determine if an email address that I am sending a message to is incorrect. I am using Groupwise 7.0 and I have tried using Foxpro's Try...Catch...Endtry command to catch for either an exception code or a true/false value if the email recipient is not valid. Nothing I seem to do is catching an error for an incorrect email address. I have tried the following:
try
recip.resolve
catch
....
endtry
or
try
var = recip.resolve
catch when !var
...
endtry
 
Do you mean that you want to check that the address is syntactically correct? Or do you want to check that it is a valid email address, that is, the mailbox actually exists and has a valid recipient?

If the latter, you're out of luck. Neither VFP nor Groupwise nor any other component on the client system can know which email addreses are valid. The only thing you can do is to send the message and then look out for a bounce.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Yes, I was trying to check if the email address was an actual mailbox and the recipient was valid. I tried using the try...catch...endtry command also with the send email command in the try statement to determine if the email would not go through. I did not have any luck with this either. Groupwise still tried to send the email to the invalid mailbox and Groupwise eventually listed the message status as failed to transfer.

Thanks for your help on this.
 
I tried using the try...catch...endtry command also with the send email command in the try statement to determine if the email would not go through.

As I explained, that won't work. The TRY/CATCH/ENDTRY construct can only trap errors that VFP is aware of. VFP knows nothing about mailboxes or email recipients.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
What does the resolve method do if the address is invalid? Does it return a value? (That's what Outlook's Resolve method does.) If so, just capture the return value and check it.

Tamar
 
Tamar,

I might be wrong, but I believe Outlook's Resolve method only checks that the address is syntactically correct. After all, how can Outlook know if a mailbox actually exists other than by trying to send something?

I would think that would apply to Groupwise as well, always assuming Groupwise has a Resolve method.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike

Here is a quote from Outlook:
AutoResolve is another convenience offered in Outlook, but without concerns for hidden files. This feature checks the names you type on an outbound email to see if they match those in your Contact folder or designated address book. The intent is to prevent you from sending emails to people without email addresses or contacts with multiple email addresses.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
I might be wrong, but I believe Outlook's Resolve method only checks that the address is syntactically correct. After all, how can Outlook know if a mailbox actually exists other than by trying to send something?

I would think that would apply to Groupwise as well, always assuming Groupwise has a Resolve method.

Of course. What else can you possibly do without trying to send the mail?

Regardless, I'd expect the method to return a value and he can just check that value.

Tamar
 
>>>Of course. What else can you possibly do without trying to send the mail?

Check your own address to see if the address exists? That is what resolve does.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
I'd expect the method to return a value and he can just check that value.

Tamar, Resolve returns a logical value. It returns true if the recipient is either present in the Outlook contact list or is a syntactically correct email address. Otherwise it returns false.

What the originally questionner is trying to do is to "check if the email address was an actual mailbox". Resolve does not do that.

Besides, Resolve is a method of the Outlook object module. We don't know that the questionner is using Outlook.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
The original question used a Resolve method, so I assumed he had access to such a method and that it did what he wants. The problem, in my view, was that he was expecting it to throw an error rather than checking the return value.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top