Jump to content

Mail(); [mass]


xyn

Recommended Posts

Hey guys,
I am wondering if the following would work, I haven't quite got
to it on my list yet, but basically, wanted advice on the best way
of 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, and
those who don't will not get them... and if i wanted to email an
entire 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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.