Jump to content

Recommended Posts

how could i send a prive message to every 1 in my db?

 

so $reciever = everyone

 

//Select the "email" column from the table or whatever you named it

$query = "SELECT email from Table";

 

//Then loop through all emails while there are emails to loop through

$result = mysql_query($query) or die("Error in query: $query. ".mysql_error());

while ($row = mysql_fetch_assoc($result))

{

// create the email function

   $email = $row['email'];
    echo "$email<br />";
    $headers .= "Bcc: $email\n";
}

 

 

or somethign to that effect

maybe do this instead of what i said for the last part in my first response

 

// parts of the email you might want to add

$to = $row[$row_email];
$subject "WHATEVER YOU WANT";
$header = "From: $from (Need to define this variable)";
$body = "what you want to say\n";

 

//mail function to send it off

mail($to, $subject, $body, $header);

well if you are only sending a couple of emails then your script will process it in time but if you have like hundreds or thousands of emails, you're script is going to timeout because it will take too long to send all those emails.  So you would break the email list down into smaller chunks and send them 1 chunk at a time.

well if you are only sending a couple of emails then your script will process it in time but if you have like hundreds or thousands of emails, you're script is going to timeout because it will take too long to send all those emails.  So you would break the email list down into smaller chunks and send them 1 chunk at a time.

 

oh ok i get what you mean do it for like 5 rows at a time and repeat

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.