By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

email verification

P: 18
Hi..

I want a php function that validates emails for me. how can I do that?
I don't want to send the email neither use activation link. I want something like:
<Links removed>

I tried to search on the internet but nothing is found useful.

Many thanks in advance.

Regards,
HK
Aug 22 '08 #1
Share this Question
Share on Google+
8 Replies


dlite922
Expert 100+
P: 1,584
why do you need this? for your application? or are you trying to build this to provide this verification service for users?
Aug 22 '08 #2

P: 18
it is used for my application..I want to send more than 40000 emails but many of them are not valid.
Aug 23 '08 #3

Atli
Expert 5K+
P: 5,058
Hi.

There is no reliable way of "verifying" that an email exists.
It is possible to "ask" a mail server if the email exists, but you have no guarantee that the server will respond accurately. Many of them will attempt to mask the existence of their users, giving false negatives even for valid emails, or give false positives for all queries.

For example, the links you posted earlier gave a false positive for an email I know doesn't exist.

The one thing you can do, really, is verify that the email *address* is valid and either blindly accept the address, or resort to sending verification emails.
Aug 25 '08 #4

P: 18
Hi..
but there are many web services did this validation and it worked even for hotmail and yahoo.

i.e.
<link removed>

most of my users are from a domain that give true positive reply..and very few are hotmail, gmail and yahoo users. thats why i want to minimize the number of sent emails or i will not give high priority for sending.
Aug 25 '08 #5

Atli
Expert 5K+
P: 5,058
After taking a closer look at those links, I've removed them, as they both violate the Posting Guidelines.
Links containing advertisements are not allowed, and are generally considered to be spam.
(Especially when said advertisement is no more than an attempt to get your email address into a spammers mailing-list, like one of your links was)

Please try to refrain from posting links like that in the future.

Thanks.
MODERATOR
Aug 25 '08 #6

Atli
Expert 5K+
P: 5,058
If you want to try to query the server, you could use the socket functions to communicate with a mail server.

A typical mail SMTP query goes like:
(from Wikipedia)
Expand|Select|Wrap|Line Numbers
  1. S: 220 smtp.example.com ESMTP Postfix
  2. C: HELO relay.example.org
  3. S: 250 Hello relay.example.org, I am glad to meet you
  4. C: MAIL FROM:<bob@example.org>
  5. S: 250 Ok
  6. C: RCPT TO:<alice@example.com>
  7. S: 250 Ok
  8.  
If that last line is 250 Ok, as it is, the email should be valid, according to the server.
Aug 25 '08 #7

Markus
Expert 5K+
P: 6,050
If you want to try to query the server, you could use the socket functions to communicate with a mail server.

A typical mail SMTP query goes like:
(from Wikipedia)
Expand|Select|Wrap|Line Numbers
  1. S: 220 smtp.example.com ESMTP Postfix
  2. C: HELO relay.example.org
  3. S: 250 Hello relay.example.org, I am glad to meet you
  4. C: MAIL FROM:<bob@example.org>
  5. S: 250 Ok
  6. C: RCPT TO:<alice@example.com>
  7. S: 250 Ok
  8.  
If that last line is 250 Ok, as it is, the email should be valid, according to the server.
But as you said: this isn't reliable. I don't see the problem with mailing the user an activation key to their given email address.
Aug 25 '08 #8

Atli
Expert 5K+
P: 5,058
But as you said: this isn't reliable. I don't see the problem with mailing the user an activation key to their given email address.
Me neither, but if he doesn't want to do that, he's got very little choice.

This is made unreliable for a reason. If a server gives out this sort of info to easily, spammers could simply query mail servers in a "brute-force" manner and get a complete list of valid emails, which is not good, obviously.
Aug 25 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.