Grimloch Posted September 6, 2009 Share Posted September 6, 2009 System: PHP-Fusion ver7 CMS Hello again. I have a newsletter infusion(mod) that works great as is. But I need to modify it so that each recipient is personalized and they don't see all the other users email addresses in the TO: line of the email. No matter how I configure this puppy it still sends emails with all the addresses showing in the To field. My last attempt shown in the code below, was to put the entire 'db query/mail send' routines in a foreach loop. It doesn't work to personalize each email. This is interfacing to the php_mailer mail send function. Any insight would be very much appreciated. The $_POST['sendto'] is an array of email addresses gathered from my multi-select function. // New mail send routine for single/multiple user(s) require_once INFUSIONS."newsletters/newsletters_include.php"; $error = ""; $subject = stripslash($_POST['subject']); $my_array = ($_POST['sendto']); if ($_POST['format'] == "plain") { $content = stripslash($_POST['content']); } else if ($_POST['format'] == "html") { include INFUSIONS."newsletters/include/html_header_include.php"; $content .= stripslashes($_POST['content'])."\n"; $content .= "</body>\n</html>\n"; } _load_PHPMailer(); $mail = new MyMailer; $mail->Subject = $subject; if ($_POST['format'] == 'plain') { $mail->Body = $content; } else { $mail->AltBody = $locale['nl423']; $mail->Body = $content; } foreach ($my_array AS $emails) { $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_email='$emails'"); if (dbrows($result)) { $rows = dbrows($result); $bcc_list = ""; while ($data = dbarray($result)) { if ($_POST['delivery'] == "bcc") { $mail->AddBcc($data['user_email']); } else { $mail->AddAddress($data['user_email'], $data['user_name']); if (!$mail->Send()) { $error = $locale['nl417']; } if ($rows > 1) { $mail->ClearAddresses(); } } } } } Quote Link to comment Share on other sites More sharing options...
Grimloch Posted September 7, 2009 Author Share Posted September 7, 2009 You know, I don't know if it's the way I put things, the way I ask questions or if people just don't really like to try to deal with mail scripting problems or what. I've noticed that (most people) that pose questions/problems on here get some kind of response within a few hours at the most. So just go ahead and forget about this one. I'll mark it as solved and try to figure it out myself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.