php code to validate email adressess

Discussion in 'PHP' started by fafa7080, Oct 21, 2008.

  1. #1
    hi all
    iam newbie in php
    i want to create a form in php
    in which it has some filelds
    like username:
    email address1:
    email address2:
    email address3:

    submit button

    i want to create a form something look like this in which the person who is
    member of my site will put his username in the filed
    and he has to introduce 3 valid email addresses in their corresponding fields
    to get some advantages from my site
    but i want to have some procedure in which it checks the email addresses
    to see whether they are real email addresses
    and by clicking submit button one copy of the 3 email addresses will be emailed to me as well

    how can i do that to check the email addresses to see they are real
    is there any way to do that
    suppose the user enters or something which is not exists
    i mean i want to check both the domain name and the email address
    maybe he enters or
    in which in both the first the domain is not exist
    and second the email address is not valid or maybe deactivated
    how can i check that
    and by the way i want to be sure that the user put the email address
    also correctly
    suppose he does not miss @ and if he did the error message shows that
    this@ is missing

    is it possible suppose to use a smtp server inside the code
    to email the address which the user puts inside the filed
    and it automatically emails the 3 email addresses
    and if the mail daemon delivery emails back it will undrestand that the email
    is not correct or does not exist and near the filed of that email address shows email is not verified
    but is should read the header of the email
    cause maybe the server has some auto response which is not a mail delivery deamon

    is there any way i can do this?
     
    fafa7080, Oct 21, 2008 IP
  2. srikanthever4u

    srikanthever4u Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    i want same thing .
    to verify email address ,iam using to check dns
    but not working properly
     
    srikanthever4u, Oct 21, 2008 IP
  3. seokochin

    seokochin Banned

    Messages:
    298
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use regular expression to validate email :

    sample code :

     
    seokochin, Oct 21, 2008 IP
  4. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    dude what i want is explained above
    i want a form
    to do 3 things all together
    1)check the @ and the domian named not missed
    2)check the dns whether exist
    3)check the email address on that domain name
    if all the 3 above works fine show a message near the field that email addresses mentioned are verified
    4)captcha code for not being used by robots
    using smpt server or any other method
    5) by clicking a submit button a copy of the 3 email addresses will send to my email address
     
    fafa7080, Oct 21, 2008 IP
  5. CarPriceDatabase

    CarPriceDatabase Guest

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    #1 should be handled by using regular expression as mentioned, although I didn't check his code.

    #2 I think after you parse the email addresses and use
    checkdnsrr("Email Domain parsed", "MX");
    PHP:
    and you will get a bool value to tell you if the domain is correct

    #3 I don't think it can be done unless you actually send an email to the address, but see if you get other responses from others.

    #4 should be a seperated issue as you could store a string in database and use another code to display the picture.

    #5 is not php, it is purely html.
     
    CarPriceDatabase, Oct 21, 2008 IP
  6. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #6
    thanks for the reply, for #3 it should use smtp server i suppose
    but i dont know how
     
    fafa7080, Oct 21, 2008 IP
  7. CarPriceDatabase

    CarPriceDatabase Guest

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think you should try POP or IMAP, not SMTP.
     
    CarPriceDatabase, Oct 21, 2008 IP
  8. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #8
    any help with the code will be appreciated
     
    fafa7080, Oct 21, 2008 IP
  9. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    anybody ????
     
    fafa7080, Oct 21, 2008 IP
  10. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #10
    2 days passed still nobody has this script?
     
    fafa7080, Oct 22, 2008 IP
  11. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #11
    is this registration? one way of doing this sending an email to the user trying to register with a confirmation code.
    email has a link with the encrypted confirmation code. then will validate the registration if the encrypted code is accurate with the user..

    some other way of what you are thinking is connecting to other server, like getting through the servers of google,msn,yahoo, etc.. this might take you too long to have some answers.. i dont know if this can be done and if they are going to give you an access to their server or some other way.. also use captcha for verification of users..

    hey check this site http://www.phpclasses.org, ive used a class their that detects if the yahoo id is either login or logout.. maybe it can give you some ideas..
     
    bartolay13, Oct 22, 2008 IP
  12. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #12
    but i prefer that you send an email with the encrypted code... that should do it
     
    bartolay13, Oct 22, 2008 IP
  13. fafa7080

    fafa7080 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #13
    dude this is not a registration, as i said this is some kind of email marketing
    which automatically send an email if those email addresses are valid
     
    fafa7080, Oct 22, 2008 IP