validate e-mail addr. / url

Hi !
How can I check if a website exists and if an e-mail adress is correct (for e-mails the @ is enough) ?

regards
ItsMe
ItsMeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KennyIT Application ExecutiveCommented:
Perhaps you can try to redirect to that website, and if successful, the site exist, else it does not.
0
furuCommented:
Mail:
There is no 100% way to check e-mail addresses. Not possible, not even close to usable.

There are way to check for e-mail address validity according to the RFC's, but, alas, the RFC's are not the only addresses that work. Also, if you validate according to what might be theoretically correct, you'll end up validating addresses like -@ (yes, that _is_ a theoretically correct mailaddress). Using advanced Regular Expressions (available in most programming languages) you can check if a mailaddress is likely to be valid. You can then use some SMTP-module or telnet to guess if the mailaddress will accept your mail.

Web:
If you are using a language like Perl (or many others( you might look at the libwww-modules (LWP for perl) for checking if a site is available. You can not check if it exsist this way because a site may exsist without being available.

The morale is: It's not 100% possible. Somewhat close to 50%, I would guess, and if you can live with that, follow the leads above for more info...
0
ItsMeAuthor Commented:
Hi furu ! Ok, I will check for the @ to check the mail adress but tell me, isn't it possible to open a link with perl and read the content somewhere in ? I'm new in Perl. If I would develop an delphi (my language) application I could read the URl into a string...then I knew this is an html document, the url is ok.

regards
ItsMe
0
furuCommented:
Yes, you can, but it won't be 100% safe. How do you know that the site isn't just temporary overloaded or that there is some network problem between you and the other site.

My point is that although you may be able to validate a site's exsistance by connecting to it, you will not be safe that a site does _not_ exsis if you can't connect to it.

Same way, a regexp of
m![a-zA-Z][\w\@]*\@([\w\@]+\.)+([\w\@])!
would probably more or less validate a mailaddress, but there is no way to make sure that the mailaddress is working.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ItsMeAuthor Commented:
Its enough for my purposes to check the @...

thanks
ItsMe
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.