PDA

View Full Version : Newsletter & PW


AndyB
10-5-05, 09:37 PM
Greetings!

I'm making a custom, newsletter/mailing-script that plugs into a MySQL db and serves a user-base of roughly 180-ish members (expected to grow). Unlike a regular newsletter, this script is intended to be used once-in-a-blue-moon; more like an administrator's announcement script.

My question regards not much of the script itself; rather, it's proper usage & programming. Does Pow-Web have any set limits, procedures, or abuse guidelines that deal with these sorts of scripts? Further, are there methods besides the standard 'for loop, mail()' snippet that stand better for my situation, or help improve it? The last thing I'd want to have is my script unintentionally pig out on resources.

For the record, this is not intended for building a SPAM-ing script or the like.
Rather, for my client, a Star Wars costuming organization known as The Jedi Assembly (http://www.thejediassembly.com/). Come visit us! ;)

Here is a sample of code pertinent to the issue. Note that a few of the functions are proprietary.

$sql = db_connect();
$mbrSQL = mysql_query("SELECT jedi, addr FROM xxxx;");
$list = array(); $i = 0; while ($rcrd=mysql_fetch_assoc($mbrSQL)){
$list[$i] = $rcrd; $i++;} db_close($sql);

for ($i=0;$i<count($list);$i++) {
@mail($list[$i]["addr"],securityStrip($_POST["subject"]),"Greetings, ".$list[$i]["jedi"]."!\n\n".securityStrip($_POST["$content"]),"From: do_not_reply@thejediassembly.com");
usleep(50000);
}


If someone can fill me in on this issue or offer script suggestions, it would be loads of help. Thank you. :)

BerksWebGuy
10-5-05, 11:17 PM
Most limits are stated under TOS (http://powweb.com/PowWeb/Company/Policy/TOS).

180 shouldn't be an issue (even 800 shouldn't be an issue).

RTH10260
10-7-05, 08:44 AM
Does Pow-Web have any set limits, procedures, or abuse guidelines that deal with these sorts of scripts? There is a recommendation of not to send more than 1000 mails per day. I don't think this is enforced at the time being.

BerksWebGuy
10-7-05, 08:51 AM
It will be enforced if it is considered spamming, or causing a resource problem with the mail servers.

RTH10260
10-7-05, 08:52 AM
Further, are there methods besides the standard 'for loop, mail()' snippet that stand better for my situation, or help improve it? My suggestion is to not use the mail() command of PHP, which will invoke sendmail on the webserver. Powweb's webservers are prone to be blacklisted for spamming.

The better solution is to send mail by SMTP thru the your domains mail server. Also add a SPF record to the DNS. This helps the mail servers at the recipients side to identify valid emails from spam with spoofed addresses.

To assist sending mail by SMTP, I like to recommend the use of this php class:
http://phpmailer.sourceforge.net.
Check the examples to see how easy to use.