Hello
I need some help, I am trying to do a form with more than a recipient. I ve seen a post where the following code is supposed to work, but for me, it does not send any email. I ve played aroud with parameters and code but no luck.
If you see why it does not work, just let me know. If you feel like this code will never email anything and know a better solution, be nice and point to something right
The form:
edited the code tags<br><br>Post edited by: GreyHead, at: 2007/12/14 17:22
I need some help, I am trying to do a form with more than a recipient. I ve seen a post where the following code is supposed to work, but for me, it does not send any email. I ve played aroud with parameters and code but no luck.
If you see why it does not work, just let me know. If you feel like this code will never email anything and know a better solution, be nice and point to something right
The form:
<strong>Destinataire:</strong><br /><br />
<label>
<select name="recipients[]" multiple="multiple" >
<option value="em1">Comité départemental du Cantal</option>
<option value="em2">Comité départemental du Cher</option>
<option value="em3">Comité départemental de la Corrèze</option>
<option value="em4">Comité départemental de la Haute-Loire</option>
<option value="em5">Comité départemental du Puy de Dôme</option>
<option value="em6">test</option>
</select>
</label>
<br /><br />
<strong>Votre nom:</strong><br /><br />
<INPUT TYPE="text" SIZE=45 NAME="name">
<br /><br />
<strong>Your Email:</strong><br /><br />
<INPUT TYPE="text" SIZE=45 NAME="email">
<br /><br />
<strong>Sujet:</strong><br /><br />
<INPUT TYPE="text" SIZE=45 NAME="subject">
<br /><br />
<strong>Message:</strong><br /><br />
<TEXTAREA NAME="message" COLS=45 ROWS=5 WRAP="virtual"></TEXTAREA>
<br />
<br />
{imageverification}
<br />
<br />
<input name="submit" value="Envoyer" type="submit"><br /><br />
The on submit:<?php
$emails=array('em1'=>'mail1@mail1.fr', 'em2'=>'mail2@xxxxxx.fr', 'em3'=>'xxxxx.xxxx@xxxxxx.fr','em4'=>'yyyy@yyyy.fr','em5'=>'wwwww@wwww.fr','em6'=>'ddddd@ssss.fr');
$em_array= array();
foreach ( $_POST['recipients'] as $em ) {
$em_array[] = $emails[$em];
}
$rows[0]->extraemail = implode(",", $em_array);
?>
and the debug I get when I use the form:_POST: Array ( [recipients] => Array ( [0] => em6 ) [name] => test [email] => test@test.com [subject] => test [message] => test [chrono_verification] => U26MG [submit] => Envoyer )
edited the code tags<br><br>Post edited by: GreyHead, at: 2007/12/14 17:22