Well, here's what I got so far:
Now I use SwiftMailer - which uses the SMTP to send emails - so I guess SMTP sending is solved with my script...
Well, at the moment I have the total of 400 emails in a group so I guess it won't clog the system...
The IIS is not an issue sine I have *nix system here...
Now, I know that helping me with my problem without actually seeing the code is to say it mildly hard so here goes:
$mail = new PHPMailer();
$mail->From = "$_SESSION[reply]@somesite.com";
$mail->FromName = "Site's newsletter";
if(isset($_SESSION['tmID']) && is_array($_SESSION['tmID'])){
while(list($k,$v)=each($_SESSION['tmID'])){
while(list($key,$val)=each($v)){
$sql = my_query("SELECT * FROM $MEMB WHERE id = '$key' AND signed='1'");
if(mysql_num_rows($sql)>0){
$r = mysql_fetch_assoc($sql);
$mail->To("Site newsletter <maillist@somesite.com>");
$mail->AddBcc($r['email']);
$member_name = $r['firstName']." ".$r['lastName'];
$mail->WordWrap = 80;
$mail->Subject = $subj;
$message = str_replace('{ID}',$r['id'],$message);
$mail->Body = str_replace('{MEMBER_NAME}', $member_name, $message);
$mail->isHTML(true);
$message2 = stripslashes($message2);
$message2 = str_replace('{ID}',$r['id'],$message2);
$mail->AltBody = str_replace('{MEMBER_NAME}', $member_name, $message2);
$mail->Send();
$mail->ClearAddresses();
}
}
}
}
Now one important detail:
Each $SESSION['tmid'] looks something like: [$lim][$r['id']] where $lim is a number dividable by 50 and $r['id'] is a member's id - so basically what I get when I cycle through it is something like:
$SESSION['tmid'][50][75] = 1; //this means that user with id 75 which is listed in the group of users from the database that are located between 50 and 100 is selected for sending - somewhat complicated, but I had to do it but that's not the issue here
Does this code make any sense to you? Now, I'm developing a new one since this type crashed the server and I'm calling SMTP for every email and I hope it will work O.K. although haven't tested it so far. When I finish it I'll post that one as well...
Thanx for taking an interest...