SitePoint Sponsor

User Tag List

Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 84
  1. #26
    nathan cobb
    SitePoint Community Guest
    >Why one need to provide an email address? To get a newsletter, a confirmation of the purchase at an online shop etc.
    So, if i provide a wrong email address intentionally, what sense would that make?<

    people use invalid email address to prevent shady site ops from selling it to even shadier and very often illegal spammers. boo to those giving their 'white papers' away on condition that the readers must suffer viagra ads for the rest of their emailing lives. boo!! >:(

  2. #27
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 1337-Dev
    [color=#f1f1f1]
    Function:
    PHP Code:
    function validate_email($email)
    {
    // Create the syntactical validation regular expression
    $regexp "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
    // Presume that the email is invalid
    $valid 0;
    // Validate the syntax
    if (eregi($regexp$email))
    {
         list(
    $username,25/08/2004omaintld) = split("@",$email);
         
    // Validate the domain
         
    if (getmxrr(25/08/2004omaintld,$mxrecords))
             
    $valid 1;
    } else {
         
    $valid 0;
    }
    return 
    $valid;

    Then in the code, this is the check:
    PHP Code:
    if validate_email($email)

    echo 
    'email is valid'
    }
    else

    echo
    'email is not valid';
    }
    [
    color=#f1f1f1][/color] 


    Regards,

    1337

    That code is useless. First the REGEX will illiminate lots of legal email addresses. For example 6 figure TLDs are becoming quite common. Also a space and various other characters are legal.

    Also you are using getmxrr(). This only checks for an MX record but an MX record is not required for sending email. Reading from the manual 'Note: This function should not be used for the purposes of address verification. Only the mailexchangers found in DNS are returned, however, according to RFC 2821 when no mail exchangers are listed, hostname itself should be used as the only mail exchanger with a priority of 0'. I run a domain for a couple of years with no MX records and only added them because I found people were using this errornous form of email validation.

  3. #28
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you make such script were I can upload a list of e-mailadresses?

  4. #29
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The use of checkdnsrr() and getmxrr() for validating email addresses shows a complete lack of knowledge of the pertinent RFC. According to RFC 2821 when no mail exchangers are listed, hostname itself should be used as the only mail exchanger with a priority of 0. This is a configuration I have used many times and in fact the only time an MX record is needed is when the webserver and smtp server are at different IPs.

  5. #30
    Phlippe Jadin
    SitePoint Community Guest
    I think there is a security vulnerability with this script. What happens if the user forge the email address? Something like (incorrect syntax) :

    user@exit; format c:

    ?

    Exec is dangerous, allways validate data before passing it to exec.

  6. #31
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a good initial check but you'll also need to send the user an email with a link to verify their email address

  7. #32
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did a similar thing in asp by using some remote scripting and cdosys to send a verification email from the user entered address to my own domain, then looking at the cdosys response which gives a suitable error message if the from address is not regarded as valid by my provider. Is such a method more reliable with regard to bokehman's comment?

  8. #33
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even if you go to the extent of connecting to the remote mailserver and the mailserver agrees to accept mail for that address it still does not prove the address exists, only that the remote server will accept mail for it. The only sure way to know an email is good is to send an email to it containing a token and wait for confirmation.

  9. #34
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php

    // path to XPertMailer class
    require_once 'XPertMailer.php';

    $mail = new XPertMailer;

    // optionaly, you can put 2'nd parameter value 'true' to verify MX host
    $itis $mail->is_mail('user@address.net'true);

    echo 
    $itis "It's true" "Opps, something wrong";

    ?>
    Enjoy, For more informations, visit: www.xpertmailer.com

  10. #35
    Photin
    SitePoint Community Guest
    And how many there is a print on the photoprinter? Who knows?

  11. #36
    David
    SitePoint Community Guest
    Hi
    I can not find coordinates for a feedback.

  12. #37
    Dori
    SitePoint Community Guest
    Hi
    Good site. It would be desirable to return again and again!

  13. #38
    Polok
    SitePoint Community Guest
    Good site. Me very much has liked.

  14. #39
    Gorga
    SitePoint Community Guest
    Than will be engaged today?

  15. #40
    Petr
    SitePoint Community Guest
    Hi! Who knows still sites similar to this?

  16. #41
    gambling reviews
    SitePoint Community Guest
    Hi. Images are not loading.

  17. #42
    Martin
    SitePoint Community Guest
    Hi. You have very nice website! Beautiful design.

  18. #43
    Gerald
    SitePoint Community Guest
    Greetings to all! Excuse for this message, but at you excellent design of a site! Very much it was pleasant to me, I shall come here very often!

  19. #44
    ac
    SitePoint Community Guest
    Just what I was looking for.

    Cheers :)

  20. #45
    Bob
    SitePoint Community Guest
    Thanks for the code,
    I have been looking into Net_DNS (resolver) Package in Pear

    (CODE EXTRACT)
    require_once 'DNS.php';
    $resolver = new Net_DNS_Resolver();
    $email_domain = explode("@",$toemail);
    $response = $resolver->query($email_domain[1], 'MX');
    if (! $response) {
    $_SESSION['status'] = "You have entered an Invalid To Email Address";
    header("Location: ".$base_url."index.php");
    exit;}

    but it won't work, any ideas

  21. #46
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is interesting that when I enter a new domain the code gives first FALSE after a while of executing. When I refresh it then it gives directly TRUE.

  22. #47
    Dave
    SitePoint Community Guest
    How do you verify their email addresses by emailing them and asking them to click on the link to activate their registration?

  23. #48
    michael
    SitePoint Community Guest
    sub domains don't work... may be something to do with dns records...

  24. #49
    gordo
    SitePoint Community Guest
    the activation link by email is the best way to verify an address, then have a cron job run occassionally to delete unactivated addresses.

  25. #50
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •