Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:

    Default php mail() problem

    Hmm,

    Why does this send the emails more than once, sometimes twice, four times, six times?

    PHP Code:
    if ($_POST[send]) {
    $email $_POST["msg"];
    $query "SELECT * FROM `emailaddresses` ";
    $result mysql_query($query) or die (mysql_error()."<br />Couldn't execute query: $query"); 
    $numrows mysql_num_rows($result);

    while(
    $row mysql_fetch_array($result)) {

    $subject 'Email';
    $headers 'From: [email protected]"\r\n" .
        
    'Reply-To: [email protected]"\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    mail($row[email], $subject'Test message'$headers);

    }

    Thats just the send email part.
    Any help please?
    Thanks
    Last edited by Robbie; 20-01-2008 at 08:55 PM.

  2. #2

    Default

    Quote Originally Posted by Robbie! View Post
    Hmm,

    Why does this send the emails more than once, sometimes twice, four times, six times?

    PHP Code:
    if ($_POST[send]) {
    $email $_POST["msg"];
    $query "SELECT * FROM `emailaddresses` ";
    $result mysql_query($query) or die (mysql_error()."<br />Couldn't execute query: $query"); 
    $numrows mysql_num_rows($result);

    while(
    $row mysql_fetch_array($result)) {

    $subject 'Email';
    $headers 'From: [email protected]"\r\n" .
        
    'Reply-To: [email protected]"\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    mail($row[email], $subject'Test message'$headers);

    }

    Thats just the send email part.
    Any help please?
    Thanks
    Because it's going through the while loop and sending the email to every email int he database.. Your email must be in the database more than once?

  3. #3
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Off Topic; how dod you get your server to send emails in the first place? I can't manage it.
    i've been here for over 8 years and i don't know why

  4. #4
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:

    Default

    Fixed myself thanks anyway. And PM me lolwut

  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    The server should automatically be able to send email if the server admin has configured pop3 correctly.
    Coming and going...
    Highers are getting the better of me

Posting Permissions

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