well, swift mail is having a script that works like this:
Code: Select all
$subject = 'Some subject';
$sender = '"George Bush" <george@bush.com>';
$recipients = array();
$result = mysql_query("SELECT name, surname, email from $my_table");
while ($row = mysql_fetch_assoc($result)) {
$recipients[] = array($row['name'].' '.$row['surname'], $row['email']);
}
$message = stripslashes($_POST['themessage']);
if ($mailer->isConnected())
{
$mailer->send(
$recipients,
$sender,
$subject,
$message
);
$mailer->close();
}Code: Select all
$subject = 'Some subject';
$sender = '"George Bush" <george@bush.com>';
$recipients = array();
$thename = array();
$result = mysql_query("SELECT name, surname, email from $my_table");
while ($row = mysql_fetch_assoc($result)) {
$recipients[] = array($row['name'].' '.$row['surname'], $row['email']);
$thename[] = array($row['name']);
$message = '<p>Hi '.$thename.'</p>';
}
$message .= stripslashes($_POST['themessage']);
if ($mailer->isConnected())
{
$mailer->send(
$recipients,
$sender,
$subject,
$message
);
$mailer->close();
}Code: Select all
Hi Array
Message goes here ...Thanks a lot.
PS. I think I am not even sure if it's possible. Swiftmailer is sending the mail once only for all the addresses, taking all the addresses in an array. Had it been sending seperate mail to each, this could have been possible, as in mail(). I still would like to see what other's think, and may be Swiftmailer is not the best solution to send mass mail in that case (and in this way).
PS2. I just read the interesting story of MsGruff in http://www.phpbuilder.com/board/archive ... 12185.html ... well, nice that things have been solved ... and if Chris is back again as a moderator of this site, may be he could tell if sending personalized mass mail as I am trying would be possible with Swiftmailing, as he is the author of that code ...