Need help with php mail extract

Discussion in 'PHP' started by butchhh, Sep 3, 2006.

  1. #1
    im new at this what i need is some sort of php script that will extract the e-mail address from a page

    thank you
     
    butchhh, Sep 3, 2006 IP
  2. petronel

    petronel Peon

    Messages:
    113
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just wondering what do you need that emails for ? :D
     
    petronel, Sep 3, 2006 IP
  3. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you want to do this for an honest purpose, then copy and paste the one or two email addresses you would be seeking.

    If you are trying to build mailing lists . . . then you have found the reason why so many of us have removed email addresses from our sites and recommend that other's do the same and why some use obfuscators to thwart harvesting.
     
    clancey, Sep 3, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Your first post and you are wanting to harvest email addresses from websites? If this is really what you are doing then this is the wrong forum for you.
     
    mad4, Sep 3, 2006 IP
    Smyrl likes this.
  5. butchhh

    butchhh Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i dont need mass mail extractor what i need is just 2 extract 1 mail from 1 page for my users, and that page i want 2 be hidden and i dont have mysql database understand now?
     
    butchhh, Sep 3, 2006 IP
  6. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Are you trying to build a form so people can enter their email address?
     
    mad4, Sep 3, 2006 IP
  7. butchhh

    butchhh Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    yes something like that what i need its a box where u enter an userid and the script will need 2 get the e-mail address from other link cuz i dont have database and that link needs 2 be hidden... 4 exampe i have this link
    https://www.mysite.com/userid=USERHERE
    and in that box u enter jond doe and the script will place jon doe at userhere and get teh e-mail address from loaded page... i was thinking about a html form with the box like this
    <form action="https://www.website.com/fdsfs.php" method="get">
      <p><label for="userid">User</label>: <input id="userid" name="userid" type="text" /></p>
      <p><input id="submit" name="submit" type="submit" value="Submit" /></p>
    </form>
    Code (markup):
     
    butchhh, Sep 4, 2006 IP
  8. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If you cannot use an installed database such as MySql, you can craft your own database -- a simple text file with delimited values. Once you get the user name from the form, you could look for their record in the file and retrieve the email address and any other saved information. If you cannot find them, then they are not a registered user and you come back with a "user not found" warning.

    This requires a registration system where you collect the needed information and then write that to the flat file. You can prepopulate it with data you already have.

    When a user logs on you need to parse through the file seeking the right entry.

    This works with a small number of users. But, as your system grows, the time to collect information per user and the stress on the CPU will grow.

    Unfortunately, I do not have any code examples. But. if this is what you seek, I am sure you will find already crafted solutions. For example: BFormMail
     
    clancey, Sep 4, 2006 IP
  9. butchhh

    butchhh Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thank you clancey i managed 2 resolve the issue with the mail extract what i need now its a script in php that will load my page without showing the link like the iframe from html just that in html u can see it by view source

    edited: i made the iframe but now i need a script when i enter the userid in a box it will add it after the userid=USERHERE and load trough the iframe

    ex <iframe src="www.mysite.com/userid=USERHERE" width="100%" height="100%">
     
    butchhh, Sep 4, 2006 IP
  10. dewolfe001

    dewolfe001 Peon

    Messages:
    3
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    function extract_emails_from($string){
    preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches);
    return $matches[0];
    }

    $text = "blah blah blah email@address.com blah blah blah email2@address.com";

    $emails = extract_emails_from($text);

    print(implode("\n", $emails));

    This should parse the string for email addresses (found via http://textsnippets.com/posts/show/179).

    For all of the paranoid posts in lieu of an answer, here's a scenario where you need to parse text for email addresses: A bunch of bounced email messages come in from all sorts of mail servers. You need to parse these messages for the sender address. That one of about 100 legitimate uses for a email addresses extractor.

    Hope this helps,

    Mike
     
    dewolfe001, Sep 10, 2006 IP
    ViciousSummer likes this.