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
https://forums.phpfreaks.com/topic/36998-e-mailerarrays/
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: [email protected]";
$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
https://forums.phpfreaks.com/topic/36998-e-mailerarrays/#findComment-176574
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
https://forums.phpfreaks.com/topic/36998-e-mailerarrays/#findComment-176691
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.