Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 678 → Rev 679

/trunk/client/bottin/bibliotheque/mail_tous.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: mail_tous.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
// CVS : $Id: mail_tous.php,v 1.2 2006-01-02 09:51:03 alexandre_tb Exp $
/**
* Permet d'envoie un mail à une sélection dans l'annuaire
*
30,7 → 30,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
44,26 → 44,26
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN ;
global $action ;
$url = $GLOBALS['ann_url']->getURL() ;
$annu_table = "annuaire_tela" ;
$champs_mail = "U_MAIL" ;
$url = $GLOBALS['ins_url']->getURL() ;
 
// Entete
$corps_debut = "RESEAU TELA BOTANICA - Le ".date("j/m/Y").
"\n\nBonjour,\n"."\n\nCordialement,\n-------------------\nTela Botanica le réseau des botanistes francophones\naccueil@tela-botanica.org\nhttp://www.tela-botanica.org\n";
"\n\nBonjour,\n"."\n\nCordialement,\n-------------------\n".
"Tela Botanica le réseau des botanistes francophones\n".
"accueil@tela-botanica.org\nhttp://www.tela-botanica.org\n";
 
$res = "<h1>Envoi d'un mail &agrave; tous les membres</h1>\n" ;
 
if ($_GET['action'] == ANN_MAIL_TOUS_ENVOIE) $res .= envoie_mail_selection() ;
 
// formulaire
$res .= "<div><form action=\"$url&action=".ANN_MAIL_TOUS_ENVOIE."\" method=\"post\"><table>\n" ;
$res .= "<tr><td class=\"insLabel\">" ;
$res .= "Objet&nbsp;:&nbsp;</td><td><input size=\"91\" name=\"objet\" type=\"text\" class=\"insInputForm\"></td></tr>\n" ;
$res .= "<tr><td class=\"insLabel\">Corps&nbsp;:&nbsp;</td><td><textarea name=\"corps\" cols=\"90\" rows=\"30\" class=\"insInputForm\">$corps_debut</textarea></td></tr>\n" ;
$res .= "<tr><td></td><td><input type=\"submit\" class=\"texte_tb\" value=\"envoyer\"" ;
$res .= "<tr><td>" ;
$res .= "Objet&nbsp;:&nbsp;</td><td><input size=\"91\" name=\"objet\" type=\"text\"></td></tr>\n" ;
$res .= '<tr><td>Corps&nbsp;:&nbsp;</td><td><textarea name="corps" cols="90" rows="30">'.
$corps_debut.'</textarea></td></tr>'."\n" ;
$res .= "<tr><td></td><td><input type=\"submit\" value=\"envoyer\"" ;
$res .= " onclick=\"javascript:return confirm('Etes-vous sur de vouloir envoyer ce message !!');\"" ;
$res .= "></td></tr>\n" ;
$res .= "</table></form></div>\n" ;
78,28 → 78,28
 
function envoie_mail_selection()
{
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN, $GS_GLOBAL ;
$annuaire = "annuaire_tela" ;
$champs_mail = "U_MAIL" ;
$headers['From'] = "accueil@tela-botanica.org" ;
$headers['Subject'] = stripslashes($objet) ;
 
$corps = stripslashes($corps) ;
$headers['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ;
$headers['Subject'] = stripslashes($_REQUEST['objet']) ;
 
$corps = stripslashes($_REQUEST['corps']) ;
$requete = $_SESSION['requete_mail_tous'] ;
unset ($_SESSION['requete_mail_tous']) ;
 
$resultat = mysql_query($requete) or die ("echec") ;
$resultat = $GLOBALS['ins_db']->query($requete) ;
while ($ligne = mysql_fetch_object($resultat)) {
if (!mail($ligne->U_MAIL, $headers['Subject'], $corps, "From: ".$headers['From'])) {
return "<tr><td>Une erreur s'est produite:<br>".$mail_object->getMessage()."</td></tr>\n" ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
if (!mail($ligne[INS_CHAMPS_MAIL], $headers['Subject'], $corps, "From: ".$headers['From'])) {
return "<div>Une erreur s'est produite:<br>".$mail_object->getMessage()."</div>\n" ;
}
}
return "<div>Le mail est parti !</div>\n";
 
}
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>