Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.