Jump to content

Trying to mass email, with hidden address, help please.


thatryan

Recommended Posts

Greetings, I have a MySQL database where I am storing some basic info, one thing is an email address.  This is for my forum for church and I want to give the option to search for members, (based on another personality traits form I made) and have it return the email address, but hidden, so I just put like a checkbox next to each name.  That way you check the results whom you want to email, click submit and that sends all needed stuff to a mail form, where the $to will be populated with the email addresses. 

My problem is I am VERY new to all this, and I dont know how to store the emails as they come back form SQL and then how to send them to the form.  I am inserting relevant snippets of what I have tried so far, but I keep getting PHP error that I can't read from [].

I would appreciate any help, I am out of ideas.  THank you for reading!

 

This is my page that displays the search results;

$email = 0;

echo'<form action="forumMail.php">';

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['ministry1'] . "</td>";
echo "<td>" . $row['ministry2'] . "</td>";
echo "<td>" . $row['personality1'] . "</td>";
echo "<td>" . $row['personality2'] . "</td>";

$emails[] = $row['email'];

if($emails[$email])
{
   $email++;

   echo'<td>
	email?
	<input type="checkbox" name="mail[]" value="<?php $row[email]?>">  
	</td>';
}	

echo '</tr>';

}
echo'
<br>

<table border="0">
<tr>
<td>
<input type="submit" value="Submit">
</td>
</tr>

</form>';

 

this is a part of the form that submit invokes,

  {
foreach($POST_emails[] as $input) 
{ 
	$to = $input . ',' .""; 
}

Can I do something like this?

 

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['ministry1'] . "</td>";
echo "<td>" . $row['ministry2'] . "</td>";
echo "<td>" . $row['personality1'] . "</td>";
echo "<td>" . $row['personality2'] . "</td>";

$addresses = $row['email'] . ',';

.

.

.

then just past $address to the mail form in POST and use it as the $to?

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.