homepage Welcome to WebmasterWorld Guest from 54.235.39.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
trying to send multiple emails
help with php code to multiple emails
weddingm




msg:4259930
 4:35 pm on Jan 29, 2011 (gmt 0)

Hello all,

On the previous form I am pulling the vendor id. But then I need to get the emails from the db with the vendor id. However, I need to be able to send to all people who were previously selected.

Can you help in updating the code?

Thanks,
Matt

I hope this is enough snippet



$go_up=0;
$inputs="";
while($go_up<$num){
$go_up++;
$check_field_name="check".$go_up;
if(isset($_POST[$check_field_name])){
$value=$_POST[$check_field_name];

//display names:
$ex=explode("_toexplode_",$value);
$businessname=$ex[0];
$names.='<br>* '.$businessname;
$inputs.='<input type=hidden name='."$check_field_name".' value="'."$value".'" >';
}}

$go_up=0;
while($go_up<$num){
$go_up++;
$check_field_name="check".$go_up;
if(isset($_POST[$check_field_name])){
$value=$_POST[$check_field_name];
$value=explode("_toexplode_",$value);
$id=$value[1];

//read the email from db based on vendor id:
$sqlemail="SELECT * FROM sample WHERE dbid='$id' ";
$resultemail = @mysql_query( $sqlemail, $connection );
$rowemail = mysql_fetch_array($resultemail);
$businessemail= $rowemail['Username'];

$businessname=$value[0];
$to = $businessemail;

 

weddingm




msg:4260069
 12:51 am on Jan 30, 2011 (gmt 0)

sorry, figured it out...forgot to reconnect to the db after each one

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved