Actually, technically it is possible, although it rather flies in the
face of the store-and-forward model for email.

1) Parse the address

2) Look up the email domain, and find the MX server (mail server).

3) Contact the mail server on the incoming SMTP port, and be prepared
to speak SMTP to it.

4) 'HELO <your domain name here>' -- this may be subject to various
verification steps to prevent spamming.

4a) A response code of 250 indicates you're OK so far

5) RECV <email address here>

6) A response code in the 200's indicates success. A response in the
400's indicates a temporary failure, and in the 500's indicates that
address isn't going to work.

7) Terminate the conversation at this point, rather than proceeding on
with the protocol.

That said, you don't want to do this. For one thing, all it verifies
is that there is a mail server which will accept the mail. It doesn't
mean it's the right address, or that it doesn't end up in a junk box
somewhere. Servers are free to accept all mail, and discard unknown
address instead of delivering it, and it's not a bad way to protect
privacy.

Also, you will have to contend with all the other countermeasures that
SMTP servers implement to prevent spammers from using their system to
deliver their junk.

And finally -- even if you have a valid email address, you don't know
if it is actually owned by the person entering it.

That's why nobody does this. Instead, they ask for the email address
twice, to catch typos, and then they send a verification email, with a
verification link you click, to verify that you actually were able to
receive it.

This is a much stronger test, and more reliable, even if it is not as
immediate in terms of user feedback.

On Dec 9, 10:03 am, Mark Murphy <mmur...@commonsware.com> wrote:
> 1. This is not related to Android.
>
> 2. It is not possible, short of sending the user an email and seeing
> if it works.
>
> There are plenty of Java regular expressions you can use with the
> Pattern and Matcher classes to make sure the email address is not
> completely rubbish (e.g., missing the @ sign).
>
> On Thu, Dec 9, 2010 at 7:38 AM, Abhilash baddam
>
>
>
>
>
>
>
>
>
> <abhilash.androiddevelo...@gmail.com> wrote:
> > Hi,
> >      iam new android..can any one tell how to do email validation in
> > android...
> >       actually i have one edit text where the user have to enter email id..
> >        how can i validate whether the user entered proper mail id or not.
>
> > Regards,
> > Abhilash.B
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to