xyn Posted December 4, 2006 Share Posted December 4, 2006 Hey guys,I am wondering if the following would work, I haven't quite gotto it on my list yet, but basically, wanted advice on the best wayof sending emails to my members on a mass scale...using MAIL();Basially by retreiving all EMAILS via a SQL DB, then use JOIN();So i can just email members who WANT emails from me, andthose who don't will not get them... and if i wanted to email anentire rank etc... My guess is...<?php$sql = mysql_query("SELECT * FROM `member_tbl` WHERE `email_opt`='true'");while($row = mysql_fetch_array($sql)){$List = join(',', $row['member_email']);mail($List, $subject, $message, "From: MySite <[email protected]>");} Link to comment https://forums.phpfreaks.com/topic/29422-mail-mass/ Share on other sites More sharing options...
SharkBait Posted December 4, 2006 Share Posted December 4, 2006 You could make it so that you use the Bcc field to insert the member's email addresses that way you only really send 1 email and it gets copied to all the recipients but doesn't show who got the email rather than looping your mail() function over and over and over and over again :) Link to comment https://forums.phpfreaks.com/topic/29422-mail-mass/#findComment-135056 Share on other sites More sharing options...
mainewoods Posted December 4, 2006 Share Posted December 4, 2006 put the mail function right after the loop finishes[code]while($row = mysql_fetch_array($sql)){$List = join(',', $row['member_email']);}mail($List, $subject, $message, "From: MySite <[email protected]>");[/code]--otherswise an email get sent to one person, then 2 people, then 3 people and the first person on the list would get a huge # of identical emails Link to comment https://forums.phpfreaks.com/topic/29422-mail-mass/#findComment-135123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.