This topic is locked

Send email at user

11/3/2008 1:33:02 AM
PHPRunner General questions
M
maxcolo author

I have table "prenotazioni"
id_prenotazione

id_user

data

seat
I would want to also send the message to the consumer that has compiled, but the email of the user is in table "utenti" field "email" ,as I do to connect the varying ID_UTENTE (table prenotazioni) with EMAIL (table utenti)
[codebox]$email="admin@alice.it";
$message="";
$subject="Nuova Prenotazione Ristorante";
foreach($values as $field=>$value)
$message.= $field." : ".$value."\r\n";
mail($email, $subject, $message);[/codebox]
This code send email only to admin, powers to implement it here?

Best Regards

J
Jane 11/5/2008

Hi,
to select email from another table use following code:

$str = "select EmailField from utenti where Key=".$values["ID_UTENTE"];

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

$email = $data["EmailField"];