Oi Bernardo, tudo bom?
I think that the way to solve your problem is to use RegEx to macth a certain 'pattern' that meets the email address structure. One way to do this is using the 'TextCommands' FBA from Hamish (available at MacScripter). Unfortunately, I cannot figure out how the 'check' commands works. If he is around maybe he can tell us how to use it.
You can find several RegEx patterns to check email, including some finesses, which satisfy such pattern as:
[A-Z0-9._%-]++@[A-Z0-9._%-]+\.[A-Z]{2,4}
What I am trying to achieve is:
tell application "TextCommands"
-- the following email address has been 'scrambled' for security purpose
if check "mghilissenathotmaildotcom" matches "[A-Z0-9._%-]++@[A-Z0-9._%-]+\\.[A-Z]{2,4}" then
set theResult to "OK"
else
set theResult to "Email address is not workable"
end if
end tell
return theResult
Has are you around?
Good luck,
Michael
On Dec 2, 2005, at 8:54 AM, Bernardo Hoehl wrote:
Hi Barry,
I don't want to check if his/her smtp server is accepting messages for that particular user.
I just want to check if the address string "looks" valid, as you say: "syntactically Valid".
Sorry for not explainning my self fully.
Thanks,
Bernardo
=======
On 02 Dec, 2005, at 11:22 AM, Barry Wainwright wrote:
Valid as in "syntactically Valid" or valid as in "there's someone on the
other end"?
-- Barry
Date: Fri, 02 Dec 2005 10:59:58 -0200
Subject: Validating email address
Hi List,
I have seen this before in this list, please forgive me if I am being
stupid. The problem is commom, but I think I shouldn't spend time
building something that has be done so many times.
I have a new project in which I should try to check if each email
address inside a 1,500 addresses list is valid.
I believe that you folks might have a good handler for this task.
Can someone be so kind to post me a Validate-Email-Address Handler?
Thank you.
Bernardo Höhl
Rio de Janeiro - Brazil
__