Jump to content

mailing list help


pixeltrace

Recommended Posts

Hi,

I wouldn't recommend putting all you mailing list members in the "To:"
section. You should "Bcc:" them instead otherwise your whole list will
be visible to all of them.
You could try this:

[code]
$sql = "select name, email from mailing_list";
$result = mysql_query($sql);

$bcc = "Bcc: ";

while($row = mysql_fetch_array($result))
{
    $bcc .= $row['name']." ".$row['email'].",";
}
$to = "Me <[email protected]>";
$subject = // Whatever your subject
$body = // Whatever your body

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'You <[email protected]>'. "\r\n";
$headers .= '$bcc' . "\r\n";

mail($to, $subject, $body, $headers);
[/code]

HTH
Steve
Link to comment
https://forums.phpfreaks.com/topic/5238-mailing-list-help/#findComment-18739
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.