For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > January 2006 > check valid email adres









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author check valid email adres
Bruintje Beer

2005-12-03, 7:55 am

Hello,

When you submit your form registration data is there a way to check if the
email adres supplied is a valid email address, I mean you can really sent a
message to this email address, before processing the rest of your form
data.

John


Janwillem Borleffs

2005-12-03, 7:55 am

Bruintje Beer wrote:
> When you submit your form registration data is there a way to check
> if the email adres supplied is a valid email address, I mean you can
> really sent a message to this email address, before processing the
> rest of your form data.
>


Googling for "php valid email" should return a sufficent number of results
to get started with.


JW


Kimmo Laine

2005-12-05, 3:56 am

"Bruintje Beer" <me@knoware.nl> wrote in message
news:439173f2$0$710$5fc3050@dreader2.news.tiscali.nl...
> Hello,
>
> When you submit your form registration data is there a way to check if the
> email adres supplied is a valid email address, I mean you can really sent
> a message to this email address, before processing the rest of your form
> data.



Sure there is, just send some confirmationcode to the address and ask the
user to fill it in the form as soon as they recieve the mail. You just store
the confirmation code on the server and send it to the address client
supplied. If you just wanted to make sure the address was technically valid,
then there areof course ways to detect that the string consists of a)
username part b) the @ sign, c) followed by the domain. But this does not
really make sure that you can send something to the address.

Forcing your users to give out their real email address in this method
sounds a bit harsh. In my opinion, because of spam, people have become a bit
reluctant about giving away their real email address. I personally create a
hotmail or gmail address to be used just for the one time to confirm that I
have a valid address, if one is required in registrating to some web
service. I don't know if I'm being a tinfoil hat paranoid, but I do know
that I don't get any spam mail. ;)

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid


Dave

2005-12-06, 6:57 pm

Kimmo Laine wrote:

> Forcing your users to give out their real email address in this method
> sounds a bit harsh. In my opinion, because of spam, people have become a bit
> reluctant about giving away their real email address. I personally create a
> hotmail or gmail address to be used just for the one time to confirm that I
> have a valid address, if one is required in registrating to some web
> service. I don't know if I'm being a tinfoil hat paranoid, but I do know
> that I don't get any spam mail. ;)
>


Another way, which lets you keep a record of any response you get, is to
open a temporary address at your domain using email forwarding. My
reply-to will only work for a few months, but some I create for a
one-off, so no two sites get the same address.

I own the domain althorne.org. The other day I registered somewhere with
assdsd@althorne.org. When I can be bothered, that will be removed from
the list of addresses forwarded to my real address.
--
Dave K

http://www.southminster-branch-line.org.uk/

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. The month is
always written in 3 letters (e.g. Jan, not January etc)
Jim Michaels

2006-01-17, 9:55 pm

also look for RFC822 PHP.
I found this source code:
http://www.iamcal.com/publish/artic.../parsing_email/
works very well. also, when you get the domain name, you can check mx
records with
bool getmxrr ( string hostname, array &mxhosts [, array &weight] )

"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:43917665$0$75688$dbd49001@news.euronet.nl...
> Bruintje Beer wrote:
>
> Googling for "php valid email" should return a sufficent number of results
> to get started with.
>
>
> JW
>



Balazs Wellisch

2006-01-18, 3:55 am

[color=darkred]
You can use javascript on the client side or a regex match with php on the
server side to make sure the email has a valid format. But, you won't really
know if you can really send an email to that address until the email is
sent. It might still bounce back for a number of reasons.

Balazs


usenet@isotopeREEMOOVEmedia.com

2006-01-18, 6:57 pm

On Wed, 18 Jan 2006 06:04:25 GMT, "Balazs Wellisch" <balazs@neusolutions.com>
wrote:

>
>You can use javascript on the client side or a regex match with php on the
>server side to make sure the email has a valid format. But, you won't really
>know if you can really send an email to that address until the email is
>sent. It might still bounce back for a number of reasons.
>
>Balazs
>


For the server side validation, this is a useful class:
http://www.phpclasses.org/browse/package/13.html

- Simple validation just by looking at the e-mail address string.
- Validation of a e-mail address host as a valid mail exchange domain.
- Validation of a e-mail address by connecting to the mail host server to
determine if there is really a deliverable mail box.
- Works under Windows or other platforms that do not have the GetMXRR function
enabled, using Moriyoshi Koizumi DNS resolver class.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com