page=message – Institut Européen de la Forêt Cultivée
IEFC - Send a message to IEFC Network
"; // faire un left join sur contact2 //echo "id : ".$id_contact." test : ".(isset($id_contact)); $pResult = mysql_query( $queryStr ); $errMsg = mysql_error(); $nr =mysql_num_rows( $pResult ); if ($nr == 0){ echo $queryStr."
".$errMsg; echo "
Unknown contact!"; } else { $rowArray = mysql_fetch_array( $pResult ); $destinataire = "Mailing list ".$id_mailinglist; $mel_copiecachee = ereg_replace( "@", "%",$rowArray["Mel2"]); for ($i=2;$i<=$nr;$i++){ $rowArray = mysql_fetch_array( $pResult ); $mel_copiecachee .= ", ".ereg_replace( "@", "%",$rowArray["Email"]); } $mel_destinataire = "orazio@iefc.net"; //$mel_destinataire= ereg_replace( "@", "%",$rowArray["Mel2"]);// masquage des aro //echo $mel_destinataire; } } if (isset($id_contact)){ include ("/usr/local/apache/htdocs/IEFC/util/mdp/connexion_directory.php"); $tablename="web_contact"; $dbname="directory"; $nomid="id_contact"; mysql_connect($host, $user,$password) or die("erreur de connexion au serveur"); mysql_select_db($bdd) or die("erreur de connexion a la base de donnees"); $queryStr="SELECT First_Name, Last_Name, id_contact, Email FROM $tablename WHERE id_contact = $id_contact"; //echo "id : ".$id_contact." test : ".(isset($id_contact)); $pResult = mysql_query( $queryStr ); $errMsg = mysql_error(); $nr =mysql_num_rows( $pResult ); if ($nr == 0){ echo $queryStr."
".$errMsg; echo "
Unknown contact!"; } else { $rowArray = mysql_fetch_array( $pResult ); $destinataire = $rowArray["First_Name"]." ".$rowArray["Last_Name"]; $mel_destinataire= ereg_replace( "@", "%",$rowArray["Email"]);// masquage des aro } } if (isset($id_site)){ include ("/usr/local/apache/htdocs/IEFC/util/mdp/connexion_treedata.php"); $tablename="Site"; $dbname=$bdd; $nomid="id_site"; mysql_connect($host, $user,$password) or die("erreur de connexion au serveur"); mysql_select_db($bdd) or die("erreur de connexion a la base de donnees"); $queryStr="SELECT `Responsible_name` as Dest, `responsible_e-mail` as Email, id_site FROM $tablename WHERE id_site = '$id_site'"; //echo "id : ".$id_contact." test : ".(isset($id_contact)); $pResult = mysql_query( $queryStr ); $errMsg = mysql_error(); $nr =mysql_num_rows( $pResult ); $rowArray = mysql_fetch_array( $pResult ); if ($nr == 0 or $rowArray["Email"]===NULL ){ //echo $queryStr."
".$errMsg; echo "
Unknown contact or missing email!"; } else { $destinataire = $rowArray["Dest"]; $mel_destinataire= ereg_replace( "@", "%",$rowArray["Email"]);// masquage des aro } } //echo $id_contact."
".$queryStr."
".$errMsg; if (isset($id_essai)){ include ("/usr/local/apache/htdocs/IEFC/util/mdp/connexion_essais.php"); $tablename="plot"; $dbname=$bdd; $nomid="plot_id"; mysql_connect($host, $user,$password) or die("erreur de connexion au serveur"); mysql_select_db($bdd) or die("erreur de connexion a la base de donnees"); $queryStr="SELECT `Responsible name` as Dest, `responsible email` as Email, plot_id FROM $tablename WHERE plot_id = '$id_essai'"; //echo $queryStr; //echo "id : ".$id_contact." test : ".(isset($id_contact)); $pResult = mysql_query( $queryStr ); $errMsg = mysql_error(); $nr =mysql_num_rows( $pResult ); $rowArray = mysql_fetch_array( $pResult ); if ($nr == 0 or $rowArray["Email"]===NULL ){ //echo $queryStr."
".$errMsg; echo "
Unknown contact or missing email!"; } else { $objet="About your FORESTRIAL #$id_essai"; $destinataire = $rowArray["Dest"]; $mel_destinataire= ereg_replace( "@", "%",$rowArray["Email"]);// masquage des aro } } //echo $id_contact."
".$queryStr."
".$errMsg; if (isset($id_model)){ include ("/usr/local/apache/htdocs/IEFC/util/mdp/connexion_modeles.php"); mysql_connect($host, $user,$passbdd) or die("erreur de connexion au serveur"); mysql_select_db($bdd) or die("erreur de connexion a la base de donnees"); $queryStr="SELECT Id, Name, email FROM $tablename WHERE Id = $id_model"; //echo "id_model : ".$id." test : ".(isset($id_model)); $pResult = mysql_query( $queryStr ); $errMsg = mysql_error(); $nr =mysql_num_rows( $pResult ); if ($nr == 0){ echo $queryStr."
".$errMsg; echo "
Unknown contact!"; } else { $rowArray = mysql_fetch_array( $pResult ); $destinataire = $rowArray["Name"]; $mel_destinataire= ereg_replace( "@", "%",$rowArray["email"]); } } if ($mel_destinataire=="" && $destinataire!="" && !is_long($id_contact) ){ $mel_destinataire = $destinataire."%iefc.net"; } // vérification de validité d'adresse email //$regex = "/^[-+.\w]{1,64}@[-.\w]{1,64}\.[-.\w]{2,6}$/i"; //if (preg_match($regex, $courriel)) { // $courriel_valide= true; //} else { // $courriel_valide= false; //} if ($message=="" || ($decode['success'] == true)){ //echo "code:".$code."chk_crypt:".chk_crypt($code) ?>

Contact :


Send a message

method='post' onSubmit='return twValide(this);'>
destinataire : $destinataire ; mel dstinataire:$mel_destinataire ; auteur : $auteur; message:$message"; if ($message!="" && $mel_destinataire!="" && $auteur!="" && chk_crypt($code)){ //$entete = "From: $auteur\nContent-Type: text/html\n"; //$entete = "From: $auteur\nBcc: $mel_copiecachee\nReply-To: $auteur\nReturn-Path: webmestre@iefc.net\nContent-Type: text/html\n"; //$headers = 'From: '.$auteur."\n"; // Expediteur //$headers .= 'Reply-To: '.$auteur."\n"; // Mail de reponse //$headers .= 'Return-Path: webmestre@iefc.net\n'; // Retour en cas d'erreur //if ($copie!=""){$headers .= 'Cc: '.ereg_replace( "%", "@", $copie)."\n";}; // Copie Cc //if ($mel_copiecachee!=""){$headers .= 'Bcc: '.ereg_replace( "%", "@", $mel_copiecachee)."\n";}; // Copie cachée Bcc //$headers .= 'MIME-Version: 1.0' . "\n"; // Version MIME //$headers .= 'Content-type: text/html; charset=ISO-8859-1'."\n"; // l'en-tete Content-type pour le format HTML //$headers .= 'From: "Nom_de_expediteur"<'.$auteur.'>'."\n"; // Expediteur //$headers .= 'Delivered-to: orazio@iefc.net\n'; // Destinataire //$headers .= 'text/html; charset=ISO-8859-1\n'; // Type de contenu //$headers="From: $auteur\nReply-To: $auteur\nReturn-Path: webmestre@iefc.net\nContent-Type: text/html\nCc: ".ereg_replace( "%", "@", $copie)."\nBcc: ".ereg_replace( "%", "@", $mel_copiecachee)."\n"; $headers="From: \nSender: sysadmin-pierroton@inra.fr\nReply-To: $auteur\nReturn-Path: webmestre@iefc.net\nContent-Type: text/html\nCc: ".ereg_replace( "%", "@", $copie)."\nBcc: ".ereg_replace( "%", "@", $mel_copiecachee)."\n"; //$entete_webmestre = "From: $auteur\nReply-To: $auteur\nReturn-Path: webmestre@iefc.net\nContent-Type: text/html\n"; $entete_webmestre = "From: \nSender: sysadmin-pierroton@inra.fr\nReply-To: $auteur\nReturn-Path: webmestre@iefc.net\nContent-Type: text/html\n"; $debut = "\n"; $fin = ""; mail(ereg_replace( "%", "@", $mel_destinataire), $objet." [posted on IEFC/EFIATLANTIC website for $destinataire]", $debut.$message.$fin, $headers, "-f webmestre@iefc.net"); echo "message sent to $destinataire !
Back to the site"; // copie à Webmestre mail("webmestre@iefc.net", $objet." [posted on IEFC.NET - for $destinataire : $mel_destinataire et $mel_copiecachee]", $debut.$message.$fin, $entete_webmestre); }; compteur ("accueil", "en"); if ($display !="IEFCV3"){?>