Jump to content

[SOLVED] Best way to grab email addresses from MySQL and send an email....


suttercain

Recommended Posts

Hi everyone,

 

I am making a simple mail form that will SELECT email address from a MySQL table based on the userid of the person sending the email.

 

if (isset($_POST['submit'])) {
require('../database.php');
$result = mysql_query("SELECT * FROM emailList WHERE merchantId = '".$_SESSION['id']."'") or die(mysql_error());

 

What would be the most efficient way of storing the email addresses from MySQL (may be 1 or may be 100) and then sending them in BCC to all the people gathered from the MySQL table?

 

Thanks

 

SC

Alright, I tried:

[code]
<?php

if (isset($_POST['submit'])) {
require('../database.php');
$result = mysql_query("SELECT emailAlerts FROM emailList WHERE merchantId = '".$_SESSION['id']."'") or die(mysql_error());
$row = mysql_fetch_array($result);
$bcc = implode(", ", $row);
echo $bcc;
}

?>

 

But it echoes the same email address twice instead of each separate address. Any suggestions?

 

Thanks[/code]

  • 7 months later...

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.