Jump to content

A bit of a bind


envexlabs

Recommended Posts

Hey,

 

I have a project coming up that requires stores to send out newsletters to people who have subscribed. The stores cannot see the emails of people who subscribed, so all they do is insert body text and hit send.

 

Once all the emails are grabbed from the database is where i get stuck. I have NO clue where to start when it comes to sending out a mass email online.

 

Does anyone have an idea of where to start?

 

Thanks,

 

envex

Link to comment
https://forums.phpfreaks.com/topic/51355-a-bit-of-a-bind/
Share on other sites

<?php

$subject = $_POST['subject']; // From form
$body = $_POST['message']; // Received from form

$q = mysql_query("SELECT email FROM users WHERE receive_newsletter = 1");

while($row = mysql_fetch_assoc($q)) {

$to = $row['email'];
mail($to, $subject, $body);

}

?>

 

Not tested, and very basic but you get the idea :)

Link to comment
https://forums.phpfreaks.com/topic/51355-a-bit-of-a-bind/#findComment-252898
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.