Jump to content

E-Mailer/Arrays


ShibSta

Recommended Posts

I want to alert my members of a change that will affect them all but don't know enough about arrays to make the e-mailer...

 

I have a few thousand members and need to know the best way to mass email them of this important update without having the PHP Script time out.. (Something similar to the mass email system in vBulletin or something is what I'm lookin for but I don't know enough about PHP to read through it...)

 

Anyone got a tutorial or a class I can use/look at?

Link to comment
Share on other sites

well i've never done it before, never gotten round to making one. so i am not sure if this will timeout your script or not. but here, try this. (this is assuming that your members are in an sql table)

 

$headers = "From: youremail@yourdomain.com";
$subject = "yoursubject";
$msg = <<<html
Greetings [user],

This is a mass email.

Sincerely,
Site Admin
html;

$query = mysql_query("SELECT * FROM members");
while($r = mysql_fetch_array($query)){
$msg = str_replace("[user]", $r['username'], $msg);
mail($r['email'], $subject, $msg, $headers);
}

 

Hopefully that will work.

Link to comment
Share on other sites

ok, well it looks right, but youd have to try it to find if it works.

 

i know that sometimes my computer will block something liek that on its firewall or whataver, and you might want tp use SMTP or something

 

ALWAYS TRY , you cant debug without trying to run a script

Link to comment
Share on other sites

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.