<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.grafactory.net/blog/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>L'appartement - Le PHP</title>
  <link>http://www.grafactory.net/blog/</link>
  <description></description>
  <language>fr</language>
  <pubDate>Sun, 24 Aug 2008 20:09:44 +0100</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Script minimaliste : nettoyer une boite aux lettres avec une expression rationnelle</title>
    <link>http://www.grafactory.net/blog/post/2008/04/11/Ntettoyer-de-la-boite-mail-avec-PHP-CLI</link>
    <guid isPermaLink="false">urn:md5:bc1dd449a911787a357b4d56e93ef3f1</guid>
    <pubDate>Fri, 11 Apr 2008 22:13:00 +0200</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>cli</category><category>mail</category><category>php</category>    
    <description>    &lt;p&gt;Dans la catégorie des scripts minimalistes (mais néanmoins utiles), je vous propose un petit script qui permet d'effacer, en ligne de commande avec PHP &lt;acronym title=&quot;Commande Line Interface&quot;&gt;CLI&lt;/acronym&gt;, certains messages d'un compte mail en fonction d'une expression régulière précisée en paramètre et qui &lt;em&gt;matche&lt;/em&gt; le sujet du mail.&lt;/p&gt;


&lt;p&gt;Par exemple, effacer les centaines de messages de spam qui se trouvent dans une de vos nombreuses boites tant inutiles que nécessaires &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt; Autre exemple, j'exécute ce script via un cron pour nettoyer tous ce qui traine dans des boites genre &lt;em&gt;postmaster&lt;/em&gt;, &lt;em&gt;abuse&lt;/em&gt; (encore que cette dernière n'est pas trop pourrie par le SPAM), et autres bal «&amp;nbsp;no-reply&amp;nbsp;» qu'il reste quand même, pour certaines, nécessaires de consulter &lt;del&gt;tous les ans&lt;/del&gt; régulièrement.&lt;/p&gt;


&lt;p&gt;C'est un script clairement dédié à de la maintenance.  Je vous déconseille de laisser trainer ce code n'importe ou accessible via le web.&lt;/p&gt;


&lt;h4&gt;Utilisation&amp;nbsp;:&lt;/h4&gt;

&lt;pre&gt;
cleanmail -u=nom_utilisateur -p=mot_de_passe -s=imap.mondomain.tld:143 -e=&amp;quot;/SPAM/i&amp;quot;
&lt;/pre&gt;


&lt;h4&gt;Pour être sur que tous le monde a compris&amp;nbsp;:&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;-u=&lt;/strong&gt; nom d'utilisateur du compte mail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-p=&lt;/strong&gt; mot de passe du compte mail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-s=&lt;/strong&gt; serveur (pop ou imap). Toutes les options disponibles sur la fonction &lt;a href=&quot;http://fr2.php.net/manual/fr/function.imap-open.php&quot;&gt;imap_open&lt;/a&gt; de PHP sont disponible&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-e=&lt;/strong&gt; expression régulière qui sera «&amp;nbsp;passée&amp;nbsp;» à &lt;a href=&quot;http://fr2.php.net/preg_match&quot; hreflang=&quot;fr&quot;&gt;preg_match&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Le script&amp;nbsp;:&lt;/h4&gt;

&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#!/usr/bin/php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on supprime la limite d'éxecution d'un script php&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/set_time_limit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;set_time_limit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp;* cleanmail supprimer des mails d'une boite imap avec une pattern définie&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* PHP versions 5&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* LICENSE: Ce programme est un logiciel libre distribue sous licence GNU/GPL&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* @author &amp;nbsp; &amp;nbsp; Yves Tannier &amp;lt;yvesSANSPAM grafactory.net&amp;gt;&lt;br /&gt;
&amp;nbsp;* @copyright &amp;nbsp;2008 Yves Tannier&lt;br /&gt;
&amp;nbsp;* @license &amp;nbsp; &amp;nbsp;http://www.gnu.org/copyleft/lesser.html &amp;nbsp;LGPL License 2.1&lt;br /&gt;
&amp;nbsp;* @version &amp;nbsp; &amp;nbsp;0.1.0 &lt;br /&gt;
&amp;nbsp;* @link &amp;nbsp; &amp;nbsp; &amp;nbsp; http://www.grafactory.net&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// aide contextuelle&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Parametres :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -u : utilisateur&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -p : mot de passe&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -s : serveur et port (localhost:143, localhost:110, localhost:143/novalidate-cert...)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -e : expression régulière&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -h, --help : afficher cette aide...&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// recuperer les parametres passe en CLI&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// utilisateur&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;u=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$login_imap&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;-u=&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;continue&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// mot de passe&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;p=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$passwd_imap&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;-p=&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;continue&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// serveur et port&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;s=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$server_imap&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;-s=&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;continue&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// expression reguliere&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;e=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$pattern&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'-e='&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;''&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;continue&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-h'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'--help'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'SCRIPT_NAME'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;default&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;Paramètre inconnu : &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// pas d'argument&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;Veuillez preciser au moins un paramÃ¨tre !&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// connexion&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$mbox&lt;/span&gt; = imap_open&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;{&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$server_imap&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;}INBOX&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$login_imap&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$passwd_imap&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; or &lt;a href=&quot;http://www.php.net/die&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;die&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Impossible de se connecter : &amp;quot;&lt;/span&gt;.imap_last_error&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Connexion...&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// recup des headers&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$headers&lt;/span&gt; = imap_headers&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mbox&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// parcourir les messages&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$headers&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Recherche avec l'expression : &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$pattern&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$headers&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt; + &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$header&lt;/span&gt; = imap_headerinfo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mbox&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$subject&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$header&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;subject&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/preg_match&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_match&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$pattern&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$subject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mailmarked&lt;/span&gt; = imap_delete&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mbox&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Message &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$msgnum&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; supprimé&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Aucun message dans la boite&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Fin de la transaction&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// quitter et vider en meme temps&lt;/span&gt;&lt;br /&gt;
imap_close&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mbox&lt;/span&gt;,CL_EXPUNGE&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;


&lt;p&gt;Bientôt le même mais en perl &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2008/04/11/Ntettoyer-de-la-boite-mail-avec-PHP-CLI#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2008/04/11/Ntettoyer-de-la-boite-mail-avec-PHP-CLI#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/160</wfw:commentRss>
      </item>
    
  <item>
    <title>A la découverte de Jelix, l'essayer c'est l'adopter</title>
    <link>http://www.grafactory.net/blog/post/2008/03/24/A-la-decouverte-de-Jelix-lessayer-cest-ladopter</link>
    <guid isPermaLink="false">urn:md5:dd75ed95c3f8a7e6fb98955f108fdb6f</guid>
    <pubDate>Mon, 24 Mar 2008 09:31:00 +0100</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>framework</category><category>jelix</category><category>mvc</category><category>orm</category><category>php</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/logo_jelix_moyen.png&quot; alt=&quot;Logo Jelix&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;Malgré tous les avantages que j'ai pu trouver à &lt;del&gt;mon framework&lt;/del&gt; mes bouts de codes personnels basés sur plusieurs librairies &lt;a href=&quot;http://pear.php.net&quot; hreflang=&quot;fr&quot;&gt;PEAR&lt;/a&gt;, je me suis tourné vers quelques choses de plus &quot;moderne&quot; et plus homogène pour mes nouveaux développements. Après pas mal de recherches et d'essais, mon choix c'est porté sur &lt;a href=&quot;http://jelix.org/&quot; hreflang=&quot;fr&quot;&gt;Jelix&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Ca tombe bien. Un nouveau projet dont les contraintes correspondent parfaitement à l'utilisation de ce &lt;a href=&quot;http://fr.wikipedia.org/wiki/Framework&quot; hreflang=&quot;fr&quot;&gt;framework&lt;/a&gt; me permet donc actuellement de me frotter à la bête... Et je ne suis pas déçu&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Je ne vais pas rentrer dans &lt;a href=&quot;http://jelix.org/articles/presentation&quot; hreflang=&quot;fr&quot;&gt;le détail des fonctionnalités&lt;/a&gt; mais il y a tous ce qu'on peux rechercher dans un framework PHP5 orienté objet &lt;del&gt;et de classe américaine&lt;/del&gt;. &lt;a href=&quot;http://jelix.org/&quot; hreflang=&quot;fr&quot;&gt;Jelix&lt;/a&gt; ne pas fait le café comme &lt;a href=&quot;http://www.symfony-project.org/&quot; hreflang=&quot;en&quot;&gt;Symfony&lt;/a&gt; (que j'ai essayé également et qui possède de nombreux avantages) et c'est justement pas ce que je lui demande car je souhaite garder la compréhension globale de ce que j'utilise. C'est léger, rapide et extensible. Bref, que du bon pour l'instant &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Voici ce que j'en retiens principalement (liste non exhaustive). J'ai précisé, pour mémoire, les équivalents de ce que j'utilisais comme librairies PEAR&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.wikipedia.org/wiki/Object-relational_mapping&quot; hreflang=&quot;fr&quot;&gt;ORM&lt;/a&gt; puissant. J'utilisais &lt;a href=&quot;http://pear.php.net/package/mdb2&quot; hreflang=&quot;fr&quot;&gt;PEAR::MDB2&lt;/a&gt; très efficace aussi. Surtout la gestion transactions&lt;/li&gt;
&lt;li&gt;système de templates. Beaucoup mieux que &lt;a href=&quot;http://pear.php.net/package/HTML_Template_Flexy&quot; hreflang=&quot;en&quot;&gt;PEAR::HTML_Template_Flexy&lt;/a&gt; pour lequel la syntaxe dans le template reste assez réduite (exemple&amp;nbsp;: impossible d'utiliser des opérateurs de comparaisons)&lt;/li&gt;
&lt;li&gt;localisation. &lt;a href=&quot;http://pear.php.net/package/Translation2&quot; hreflang=&quot;en&quot;&gt;PEAR::Translation2&lt;/a&gt; ne m'a jamais réellement séduit.&lt;/li&gt;
&lt;li&gt;génération de formulaire. Quand on a prit l'habitude d'utiliser &lt;a href=&quot;http://pear.php.net/package/HTML_QuickForm&quot; hreflang=&quot;en&quot;&gt;PEAR::HTML_Quickform&lt;/a&gt;, on recherche forcément quelque chose de similaire.&lt;/li&gt;
&lt;li&gt;système de cache. Je n'ai pas encore eu la possibilité de comparer avec les performances de &lt;a href=&quot;http://pear.php.net/package/cache_lite&quot; hreflang=&quot;en&quot;&gt;PEAR::Cache_Lite&lt;/a&gt; mais ça semble équivalent.&lt;/li&gt;
&lt;li&gt;Quelques modules bien utiles comme la &lt;a href=&quot;http://jelix.org/articles/tutoriels/principal/crud&quot; hreflang=&quot;fr&quot;&gt;génération de CRUD&lt;/a&gt;, le module d'authentification, les acls...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La présentation détaillée et une application de tests sont disponibles sur le site officiel. Il ne vous reste plus qu'à essayer &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Si vous aviez l'intention de vous rendre aux Rencontres Mondiales du Logiciel Libre 2008 à Mont-de-Marsan, assistez à &lt;a href=&quot;http://2008.rmll.info/Conference-Jelix-un-framework-pour.html&quot; hreflang=&quot;fr&quot;&gt;la conférence sur Jelix&lt;/a&gt; de &lt;a href=&quot;http://ljouanneau.com/blog/&quot;&gt;Laurent Jouanneau&lt;/a&gt; et vous en apprendrez encore plus&amp;nbsp;!&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2008/03/24/A-la-decouverte-de-Jelix-lessayer-cest-ladopter#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2008/03/24/A-la-decouverte-de-Jelix-lessayer-cest-ladopter#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/158</wfw:commentRss>
      </item>
    
  <item>
    <title>Petite mise à jour du script de mass mailing</title>
    <link>http://www.grafactory.net/blog/post/2007/11/09/Script-de-mailing-mis-a-jour</link>
    <guid isPermaLink="false">urn:md5:979c6a60c93f2b5f66f9c58688f26ea8</guid>
    <pubDate>Fri, 09 Nov 2007 14:26:00 +0100</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>cli</category><category>mailing</category><category>php</category><category>phpmailer</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/conneries/supermegamass2000.jpg&quot; alt=&quot;Mass&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;


&lt;p&gt;C'est une mise à jour mineure. Les fonctionnalités sont les même que celles de &lt;a href=&quot;http://www.grafactory.net/blog/post/2006/06/09/125-script-de-mass-mailing-en-php&quot; hreflang=&quot;fr&quot;&gt;la première version&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;J'ai eu quelques soucis avec la classe Zend_Mail. Lors d'un envoi, suite à une mise à jour de Zend_Mail, je me suis retrouvé avec des groupes de destinataires en copie au lieu d'un envoi unitaire (pas très sérieux !).&lt;/p&gt;


&lt;p&gt;J'ai donc utilisé le &quot;bon vieux&quot; &lt;a href=&quot;http://phpmailer.sourceforge.net/&quot; hreflang=&quot;en&quot;&gt;PHPMailer&lt;/a&gt;. J'en ai aussi profité pour remplacer &lt;a href=&quot;http://pear.php.net/package/DB&quot; hreflang=&quot;en&quot;&gt;PEAR::DB&lt;/a&gt; par &lt;a href=&quot;http://www.php.net/pdo&quot; hreflang=&quot;fr&quot;&gt;PDO&lt;/a&gt;. Ce qui rend le script plus léger et plus simple à installer &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt; . Je l'ai également doté d'un fichier de configuration séparé.&lt;/p&gt;


&lt;h2&gt;Changelog&amp;nbsp;:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Utilisation de &lt;a href=&quot;http://phpmailer.sourceforge.net/&quot; hreflang=&quot;en&quot;&gt;PHPMailer&lt;/a&gt; à la place de Zend_Mail&lt;/li&gt;
&lt;li&gt;Utilisation de &lt;a href=&quot;http://www.php.net/pdo&quot; hreflang=&quot;fr&quot;&gt;PDO&lt;/a&gt; à la place de PEAR::DB&lt;/li&gt;
&lt;li&gt;Changement esthétique.&lt;/li&gt;
&lt;li&gt;Un fichier de configuration séparé.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Documentation&lt;/h2&gt;


&lt;p&gt;Vous devez télécharger &lt;a href=&quot;http://phpmailer.sourceforge.net/&quot; hreflang=&quot;en&quot;&gt;PHPMailer&lt;/a&gt;, disposer de PHP5 et l'extension PDO.&lt;/p&gt;


&lt;p&gt;Pour le reste, la &lt;a href=&quot;http://www.grafactory.net/blog/2006/06/09/125-script-de-mass-mailing-en-php&quot; hreflang=&quot;fr&quot;&gt;documentation&lt;/a&gt; de la première mouture est toujours valable. Vous pouvez également utiliser toutes les options disponibles dans PHPMailer pour adapter ce script à votre convenance (je vous laisse chercher dans le script).&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;&amp;nbsp;: Ce programme est fourni sans aucune garantie même si je l'utilise toutes les semaines pour une newsletter de 30 000 abonnés.&lt;/p&gt;


&lt;h2&gt;A faire&amp;nbsp;:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;une option pour préciser le chemin du fichier de configuration&lt;/li&gt;
&lt;li&gt;en extra, toujours le gros boulot qui consiste à analyser les retours de mail (Delivery Error).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Téléchargement&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://www.grafactory.net/dl/sendnews-0.2b.tar.gz&quot; hreflang=&quot;fr&quot;&gt;télécharger le script&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/11/09/Script-de-mailing-mis-a-jour#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/11/09/Script-de-mailing-mis-a-jour#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/153</wfw:commentRss>
      </item>
    
  <item>
    <title>Passage sur Dotclear 2 Beta7</title>
    <link>http://www.grafactory.net/blog/post/2007/07/17/Passage-sur-Dotclear-2-Beta7</link>
    <guid isPermaLink="false">urn:md5:683ee4c9ead100dc363ddacd2cf41db5</guid>
    <pubDate>Tue, 17 Jul 2007 10:22:00 +0200</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>dotclear</category><category>innodb</category><category>mysql</category>    
    <description>    &lt;p&gt;Apparement, il y avait une grosse faille de sécurité chez Dotclear. J'ai donc mis à jour. Pour mon blog, pas de problème. Pour la plateforme multiblogs que je gère, ca a été plus compliqué.&lt;/p&gt;


&lt;p&gt;Le moteur utilisé par Dotclear 2 avec Mysql maintenant InnoDB. C'est bien. Il y a des belles contraintes d'intégrité partout &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Va savoir pourquoi, l'intégrité n'était plus de mise sur la base multiblogs, il y avait des enregistrements orphelins qui ne faisaient plus référence.  J'ai du donc nettoyer un peu&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
DELETE FROM `dc_post` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_category` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_link` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_permissions` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_setting` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_spamrule` WHERE blog_id NOT IN (SELECT blog_id FROM dc_blog);
DELETE FROM `dc_media` WHERE user_id NOT IN (SELECT user_id FROM dc_user);
DELETE FROM `dc_comment` WHERE post_id NOT IN (SELECT post_id FROM dc_post);
DELETE FROM `dc_media` WHERE user_id NOT IN (SELECT user_id FROM dc_user);
DELETE FROM `dc_post_media` WHERE media_id NOT IN (SELECT media_id FROM dc_media);
DELETE FROM `dc_post_media` WHERE post_id NOT IN (SELECT post_id FROM dc_post);
&lt;/pre&gt;


&lt;p&gt;Ca pourrait-être intégré dans le code de Dotclear avant une mise à jour ?!&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/07/17/Passage-sur-Dotclear-2-Beta7#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/07/17/Passage-sur-Dotclear-2-Beta7#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/147</wfw:commentRss>
      </item>
    
  <item>
    <title>PhpMyAdmin, Vista inside ?</title>
    <link>http://www.grafactory.net/blog/post/2007/07/15/PhpMyAdmin-Vista-inside</link>
    <guid isPermaLink="false">urn:md5:b62580992c3399d92f86c420bb1eb9c4</guid>
    <pubDate>Sun, 15 Jul 2007 21:49:00 +0200</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/capture/phpmy_erreur.jpg&quot; alt=&quot;Phpmyadmin Erreur&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Une erreur windowsienne &lt;img src=&quot;/blog/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/07/15/PhpMyAdmin-Vista-inside#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/07/15/PhpMyAdmin-Vista-inside#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/146</wfw:commentRss>
      </item>
    
  <item>
    <title>Plugin importer des auteurs</title>
    <link>http://www.grafactory.net/blog/post/2007/07/05/Plugin-importer-des-auteurs</link>
    <guid isPermaLink="false">urn:md5:faef3d8de327ffe973dbdf8c54784b68</guid>
    <pubDate>Thu, 05 Jul 2007 09:47:00 +0200</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>php</category><category>plugin</category><category>spip</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/auteur_import.png&quot; alt=&quot;Logo importer des auteurs&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;Un nouvelle version de mon plugin &lt;a href=&quot;http://www.spip.net&quot; hreflang=&quot;fr&quot;&gt;SPIP&lt;/a&gt; qui permet de créer des auteurs en masse à partir d'un fichier csv.&lt;/p&gt;


&lt;p&gt;Outre l'ajout de plusieurs fonctionnalités, j'ai fais en sorte que le code soit modifiable assez facilement pour une personne ayant quelques connaissances en PHP. On m'a en effet plusieurs fois demandé comment modifier le plugin pour choisir les identifiants et mot de passe, avoir un mot de passe identique à l'identifiant...&lt;/p&gt;


&lt;p&gt;Plus d'informations sur l'article &lt;a href=&quot;http://www.spip-contrib.net/Plugin-Importer-des-auteurs-v-5,2&quot; hreflang=&quot;fr&quot;&gt;Importer des auteurs v-0.5&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/07/05/Plugin-importer-des-auteurs#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/07/05/Plugin-importer-des-auteurs#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/145</wfw:commentRss>
      </item>
    
  <item>
    <title>Passage du blog sous Dotclear 2</title>
    <link>http://www.grafactory.net/blog/post/2007/07/01/Passage-du-blog-sous-Dotclear-2</link>
    <guid isPermaLink="false">urn:md5:dcd090a7f2ae31500cf3d1df018ede86</guid>
    <pubDate>Sun, 01 Jul 2007 08:32:00 +0200</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
        <category>dotclear</category><category>php</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/dotclear_pw.png&quot; alt=&quot;dotclear_pw.png&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt; Etant un utilisateur de la première heure de Dotclear, je me devais de passer sur &lt;a href=&quot;http://www.dotclear.net&quot; hreflang=&quot;fr&quot;&gt;Dotclear 2&lt;/a&gt; Beta6. Utilisation du plugin Flat Export, changement des chemins d'images avec une ou deux requête SQL bien placée*, mise en place des redirections des anciennes URL vers les nouvelles... Reste plus que le thème à changer pour remettre le mien.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mes requêtes SQL pour le changement de /blog/images en /blog/public/images dans les champs post_content et post_content_xhtml de la table dc_post&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;UPDATE dc_post SET post_content = replace(post_content,'blog/images','blog/public/images');
UPDATE dc_post SET post_content_xhtml = replace(post_content_xhtml,'blog/images','blog/public/images');&lt;/pre&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/07/01/Passage-du-blog-sous-Dotclear-2#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/07/01/Passage-du-blog-sous-Dotclear-2#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/144</wfw:commentRss>
      </item>
    
  <item>
    <title>eZ Publish et &quot;Instant Publishing&quot; avec WebDav</title>
    <link>http://www.grafactory.net/blog/post/2007/02/05/149-ez-publish-et-instant-publishing-avec-webdav</link>
    <guid isPermaLink="false">urn:md5:b6e99016d56f0479be69a8ae1b62038c</guid>
    <pubDate>Mon, 05 Feb 2007 11:11:57 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/ezpublish.png&quot; alt=&quot;eZ Publish&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt; Je n'utilise pas encore eZ Publish mais va falloir sérieusement y réfléchir. Pourquoi&amp;nbsp;? Parceque la gestion d'un site par glisser/déposer de fichiers OpenOffice (Word aussi avec OpenXML ?) via un partage &lt;a href=&quot;http://fr.wikipedia.org/wiki/WebDAV&quot; hreflang=&quot;fr&quot;&gt;WebDav&lt;/a&gt;, c'est trop fort &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://ez.no/ezpublish/demo/ez_publish_now_flash_demo&quot; hreflang=&quot;en&quot;&gt;Un petit ''trailer'' en Flash&lt;/a&gt; pour s'en convaincre. Si vous n'êtes pas patient, attaquez directement le chapitre &quot;Instant Publishing&quot;.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://ez.no/ezpublish/demo/ez_publish_now_flash_demo&quot; hreflang=&quot;en&quot;&gt;Démonstration de eZ Publish&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/02/05/149-ez-publish-et-instant-publishing-avec-webdav#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/02/05/149-ez-publish-et-instant-publishing-avec-webdav#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/140</wfw:commentRss>
      </item>
    
  <item>
    <title>Un système de template ultra-minimaliste</title>
    <link>http://www.grafactory.net/blog/post/2007/01/24/143-systeme-de-template-ultra-simple</link>
    <guid isPermaLink="false">urn:md5:b8a70b5e6263f9546da6d626dccdabdd</guid>
    <pubDate>Wed, 24 Jan 2007 15:07:00 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;Voici un petit bout de code &lt;strong&gt;php5&lt;/strong&gt; qui permet de créer simplement des fichiers à partir d'un modèle. Comme mon explication est loin d'être évidente &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt; voici un exemple avec un fichier de zone DNS. Ici, tout ce qui est mis entre accolade doit être remplacé par sa valeur.&lt;/p&gt;



&lt;pre&gt;$TTL 3600
{domain}.               IN  SOA {ns1}.   {contactzone}. (
            {timestamp}
            10800
            3600
            604800
            3600 )

{domain}.               IN  NS      {ns1}.
{domain}.               IN  NS      {ns2}.

; Enregistrements Spf

{domain}.               IN  TXT     &quot;v=spf1 a mx ~all&quot;
mail.{domain}.          IN  TXT     &quot;v=spf1 a -all&quot;

www.{domain}.           IN  A       {ipl}
{domain}.               IN  A       {ipl}
ftp.{domain}.           IN  A       {ipl}
mail.{domain}.          IN  A       {ipl}

{domain}.               IN  MX  10  mail.{domain}.
{domain}.               IN  MX  20  mx-backup.sivit.fr.

smtp.{domain}.          IN  CNAME   mail.{domain}.
pop.{domain}.           IN  CNAME   mail.{domain}.&lt;/pre&gt;




&lt;p&gt;Voici donc la méthode en question qui s'intégrera parfaitement dans votre classe&amp;nbsp;:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** Création de fichier de configuration&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * &lt;br /&gt;
&amp;nbsp; &amp;nbsp; * Mini système de template pour créer des fichiers de configuration à partir d'un squelette&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * en remplaçant {pattern} par la valeur&lt;br /&gt;
&amp;nbsp; &amp;nbsp; *&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @access &amp;nbsp; public&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @return &amp;nbsp; &amp;nbsp;bool&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @param &amp;nbsp; &amp;nbsp;string &amp;nbsp;$orig &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fichier &amp;quot;template&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @param &amp;nbsp; &amp;nbsp;string &amp;nbsp;$dest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fichier de destination&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @param &amp;nbsp; &amp;nbsp;array &amp;nbsp; $keywords Mots à rechercher dans le template&lt;br /&gt;
&amp;nbsp; &amp;nbsp; * @param &amp;nbsp; &amp;nbsp;array &amp;nbsp; $values &amp;nbsp; &amp;nbsp; Valeur de remplacement&lt;br /&gt;
&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setConfigFile&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$orig&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$dest&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$keywords&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// contenu du fichier dans un variable&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/file_get_contents&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;file_get_contents&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$orig&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// ajout pattern&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$keywords&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;=&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$patterns&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/{&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;}/imSU&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// remplacement&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$output_content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$patterns&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// variable dans un fichier ou exception&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!file_put_contents&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$dest&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$output_content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Exception&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'Erreur dans la creation du fichier'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// }}}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;


&lt;p&gt;Pour notre exemple, je passe sur l'instanciation de la classe, On utiliserais la méthode de la façon suivante&amp;nbsp;:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on a un objet obj&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// à remplacer...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$keywords&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'domain'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'ns1'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'ns2'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'timestamp'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'contactzone'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// par :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'toto.com'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'ns1.toto.com'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'ns2.toto.com'&lt;/span&gt;,&lt;a href=&quot;http://www.php.net/date&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;date&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'Ymdi'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'technique.toto.com'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// go !&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$obj&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setConfigFile&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'zonedns.tpl'&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;'/var/cache/bind/toto.com.hosts'&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$keywords&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;


&lt;p&gt;Ce script n'a rien de révolutionnaire mais je trouve ça pratique. Ca ressemble de très loin à un système de template minimaliste &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;PS&amp;nbsp;: pour les allergiques à l'orienté objet, vous pouvez bien entendu l'utiliser comme une simple fonction&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2007/01/24/143-systeme-de-template-ultra-simple#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2007/01/24/143-systeme-de-template-ultra-simple#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/137</wfw:commentRss>
      </item>
    
  <item>
    <title>Découverte du framework Symfony</title>
    <link>http://www.grafactory.net/blog/post/2006/11/25/140-decouverte-du-framework-symfony</link>
    <guid isPermaLink="false">urn:md5:e4501703b38b21d0872757de21afc798</guid>
    <pubDate>Sat, 25 Nov 2006 09:50:08 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/038.png&quot; alt=&quot;Symfony&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt; Voici quelques jours, j'ai décidé de me lancer à l'assaut du framework &lt;a href=&quot;http://www.symfony-project.com/&quot;&gt;Symfony&lt;/a&gt; dont j'entendais parler ici et là depuis déjà quelques temps.&lt;/p&gt;


&lt;p&gt;Développé à la base par une société française (sous licence MIT), ce framework veut se la jouer &lt;a href=&quot;http://www.rubyonrails.org/&quot;&gt;Ruby On Rails&lt;/a&gt; par sa puissance pour mettre en oeuvre rapidement une application complète.&lt;/p&gt;


&lt;p&gt;Il a récemment connu une publicité inespérée. Yahoo! a en effet annoncé sont utilisation pour la réalisation de sa nouvelle plateforme &quot;social networking&quot; de gestion de bookmark.&lt;/p&gt;


&lt;p&gt;Un &quot;Admin Generator&quot; puissant, des outils complet en ligne de commande, des fichiers de descriptions d'interfaces simplifiés en XML ou en &lt;a href=&quot;http://fr.wikipedia.org/wiki/YAML&quot;&gt;YAML&lt;/a&gt;... Bref, tout ce qu'il faut pour construire une application fonctionnelle sans aucune ligne de PHP (j'exagère un peu quand même).&lt;/p&gt;


&lt;p&gt;Symfony utilise à fond les possibilités objet de PHP5 et repose notamment sur le pattern ORM (Object-relational mapping) via &lt;a href=&quot;http://propel.phpdb.org/trac/&quot;&gt;propel&lt;/a&gt; pour vous générer en quelques secondes et sans effort vos modèles de base d'accès aux données (le fameux CRUD&amp;nbsp;: Create, Read, Update and Delete).&lt;/p&gt;


&lt;p&gt;Courez donc vite sur le site de &lt;a href=&quot;http://www.symfony-project.com/&quot;&gt;Symfony&lt;/a&gt; pour y découvrir quelques vidéos et exemples qui vous donnerons sans doute envie d'aller plus loin.&lt;/p&gt;


&lt;p&gt;Si vous êtes convaincu et que vous cherchez à débuter en français, voici deux liens&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.prendreuncafe.com/blog/post/2006/06/20/473-installer-le-framework-php-symfony-sur-ubuntu-dapper-drake&quot;&gt;Installer le framework PHP Symfony sur Ubuntu Dapper Drake&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://lacot.org/blog/2006/06/26/votre-blog-sous-symfony-pas-a-pas.html&quot;&gt;Votre blog sous Symfony, pas à pas&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensuite, en anglais, pour l'instant un howto en 21 épisodes pour construire de A à Z une application&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.symfony-project.com/askeet&quot;&gt;Askeet&lt;/a&gt; Howto&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vivement plus de documentation francophone sur le sujet &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2006/11/25/140-decouverte-du-framework-symfony#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2006/11/25/140-decouverte-du-framework-symfony#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/127</wfw:commentRss>
      </item>
    
  <item>
    <title>Un plugin pour SPIP</title>
    <link>http://www.grafactory.net/blog/post/2006/10/26/138-un-plugin-pour-spip</link>
    <guid isPermaLink="false">urn:md5:7c8735dc05de8cde866f06b65edb6d80</guid>
    <pubDate>Thu, 26 Oct 2006 20:46:33 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/accueil.jpg&quot; alt=&quot;SPIP&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;[auto-promo] J'ai déposé un petit plugin sur &lt;a href=&quot;http://www.spip-contrib.net&quot; hreflang=&quot;fr&quot;&gt;Spip-contrib&lt;/a&gt;. C'est tout simple mais ça peut servir &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://www.spip-contrib.net/Plugin-Importer-des-auteurs&quot; hreflang=&quot;fr&quot;&gt;Importer des auteurs&lt;/a&gt;&lt;/strong&gt;
On a parfois besoin d&amp;#8217;ajouter un grand nombre de rédacteurs. Ce plugin le permet simplement depuis un fichier de type csv (Comat Separated Value) placé dans ecrire/data.&lt;/p&gt;&lt;/blockquote&gt;</description>
    
    
    
          <comments>http://www.grafactory.net/blog/post/2006/10/26/138-un-plugin-pour-spip#comment-form</comments>
      <wfw:comment>http://www.grafactory.net/blog/post/2006/10/26/138-un-plugin-pour-spip#comment-form</wfw:comment>
      <wfw:commentRss>http://www.grafactory.net/blog/feed/rss2/comments/133</wfw:commentRss>
      </item>
    
  <item>
    <title>SPIP 1.9 dans les bacs</title>
    <link>http://www.grafactory.net/blog/post/2006/07/02/130-spip-19-dans-les-bacs</link>
    <guid isPermaLink="false">urn:md5:fc594301e705abe7425a1b40a69eb9d0</guid>
    <pubDate>Sun, 02 Jul 2006 08:15:47 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/icones/accueil.jpg&quot; alt=&quot;SPIP&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;L'un des seul CMS traduit en esperanto et en créole réunionais vient de sortir dans une version 1.9 qui apporte un bon lot de nouveautés et une évolution majeure. On notera la possibilité d'utiliser directement la syntaxe de SPIP pour interroger n'importe quelle table. Exemple&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;BOUCLE_maboucle(MATABLE)&amp;gt;
#CHAMP_DE_MA_TABLE&amp;gt;
&amp;lt;/BOUCLE&amp;gt;&lt;/pre&gt;


&lt;p&gt;Bien pour les non codeurs &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Mais aussi un nouveau système de plugins, la possibilité de &quot;surcharger&quot; toutes les fonctions et pages, l'abandon (enfin) des .php3, une couche d'abstraction plus mieux etc... &lt;a href=&quot;http://www.spip.net/fr_article3368.html&quot; hreflang=&quot;fr&quot;&gt;Plus d'informations sur cette nouvelle version 1.9 de SPIP&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Un script simple de &quot;mass mailing&quot; en PHP</title>
    <link>http://www.grafactory.net/blog/post/2006/06/09/125-script-de-mass-mailing-en-php</link>
    <guid isPermaLink="false">urn:md5:61353e4fa8c760323ab5b9b499ef387e</guid>
    <pubDate>Fri, 09 Jun 2006 18:07:00 +0000</pubDate>
    <dc:creator>Yves Tannier</dc:creator>
        <category>Le PHP</category>
            
    <description>&lt;p&gt;&lt;img src=&quot;http://www.grafactory.net/blog/public/images/conneries/supermegamass2000.jpg&quot; alt=&quot;Mass&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;


&lt;h2&gt;Mise à jour&amp;nbsp;!&lt;/h2&gt;


&lt;p&gt;IMPORTANT&amp;nbsp;: Une &lt;a href=&quot;http://www.grafactory.net/blog/post/2007/11/09/Script-de-mailing-mis-a-jour&quot; hreflang=&quot;fr&quot;&gt;nouvelle version&lt;/a&gt; qui corrige un bug avec Zend_mail est disponible.&lt;/p&gt;


&lt;p&gt;Depuis le temps qu'il fallait que j'abandonne ce misérable logiciel de gestion de newsletter sous Winchose pas pratique du tout &lt;del&gt;j'ai nommé groupmail&lt;/del&gt; dont je tairais le nom   et qui expédie depuis la (petite) ligne ADSL Wanadoo...&lt;/p&gt;


&lt;p&gt;J'ai enfin suivi le conseil&amp;nbsp;: &lt;em&gt;do it your self&lt;/em&gt;&amp;nbsp;! Après avoir regardé avec plus ou moins d'intérêt du côté des solutions de gestion de maling list sous Linux (sympa, mailman, emzl ect...) ou des scripts de gestion de newsletter en différents languages (java, php, perl...), j'ai finalement opté pour l'utilisation de PHP en ligne de commande, CLI - Command Line Interface - pour les intimes, pour réaliser mon propre script de mass mailing.&lt;/p&gt;


&lt;h4&gt;Préface&amp;nbsp;: la situation&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;un script d'abonnement à la newsletter &quot;fait maison&quot; composé de nombreux champs&amp;nbsp;: nom, prénom, adresse, téléphone, mail, profession ect... Déclaré à la CNIL, ne m'envoyez pas la police &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/li&gt;
&lt;li&gt;une table Mysql pour stocker tout ça bien entendu&lt;/li&gt;
&lt;li&gt;un serveur dédié sous Debian avec &lt;a href=&quot;http://www.php.net&quot; hreflang=&quot;fr&quot;&gt;PHP5&lt;/a&gt;, &lt;a href=&quot;http://pear.php.net&quot; hreflang=&quot;en&quot;&gt;PEAR&lt;/a&gt;, &lt;a href=&quot;http://framework.zend.com/&quot; hreflang=&quot;en&quot;&gt;Zend Framework&lt;/a&gt; (version subersion car quelques bug sur le Zend_Mail &lt;em&gt;component&lt;/em&gt; actuel), Postfix et une bonne bande passante&lt;/li&gt;
&lt;li&gt;un message tout en html (avec quand même un texte alternatif disponible pour les fanatiques de mutt).&lt;/li&gt;
&lt;li&gt;et enfin, tout de même 25000 abonnés à cette liste&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Introduction&amp;nbsp;: comment ça marche&amp;nbsp;?&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;On exécute le script en ligne de commande (dans un screen ou en tache de fond pour le laisser tourner ensuite)&lt;/li&gt;
&lt;li&gt;Le script (interactif) demande quel fichier html il doit utiliser pour le message. Par défaut, il propose le dernier fichier trouvé dans le répertoire $dir_html&lt;/li&gt;
&lt;li&gt;Les messages sont envoyés un par un par paquets de 100 (nombre de messages par paquet configurable)&lt;/li&gt;
&lt;li&gt;Une pause de 15 secondes est effectuée entre chaque paquets. On en profite pour réinitailiser la connection avec le serveur SMTP ( le temps de la pause est également configurable).&lt;/li&gt;
&lt;li&gt;A chaque envoi réussi (la validation de l'envoi est à revoir), un champ booleen &quot;envoye&quot; est mis à jour dans la table des abonnés. En cas de plantage, il suffit donc de relancer le script pour reprendre l'expédition.&lt;/li&gt;
&lt;li&gt;Avant de relancer le script pour une nouvelle lettre d'informations, une option permet de remettre le flag &quot;envoye&quot; à zéro.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Chapitres suite et fin &lt;img src=&quot;/blog/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/h4&gt;    &lt;p&gt;Avant même qu'il ne soit fini, voici la première version pre-beta-alpha-0.0.1 (soyons fou et proposons des trucs en beta comme Gmail).&lt;/p&gt;


&lt;p&gt;Prérequis et note diverses&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;le script ne fonctionne que avec PHP5&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;un certain nombre de variables sont à configurer au début du fichier pour que ça fonctionne sur d'autres configurations (voir les commentaires)&lt;/li&gt;
&lt;li&gt;le paquet &lt;a href=&quot;http://pear.php.net/package/DB&quot; hreflang=&quot;en&quot;&gt;PEAR::DB&lt;/a&gt; est nécessaire&lt;/li&gt;
&lt;li&gt;les components &lt;a href=&quot;http://framework.zend.com/manual/fr/zend.mail.html&quot; hreflang=&quot;fr&quot;&gt;Zend_Mail&lt;/a&gt; et &lt;a href=&quot;http://framework.zend.com/manual/fr/zend.mime.html&quot; hreflang=&quot;fr&quot;&gt;Zend_Mime&lt;/a&gt; sont nécessaires&lt;/li&gt;
&lt;li&gt;la base de données peut-être autre chose que Mysql (voir les possibilités de Pear::DB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pour tester l'envoi sur une seule adresse mail&amp;nbsp;:&lt;/p&gt;


&lt;pre&gt;# sendnews -e -t&lt;/pre&gt;


&lt;p&gt;Pour remettre le &lt;em&gt;flag&lt;/em&gt; &quot;envoye&quot; à zéro dans la table (après un envoi réussi)&amp;nbsp;:&lt;/p&gt;


&lt;pre&gt;# sendnews -r&lt;/pre&gt;


&lt;p&gt;Pour envoyer&amp;nbsp;:&lt;/p&gt;


&lt;pre&gt;# sendnews -e&lt;/pre&gt;


&lt;p&gt;Pour visualiser l'aide&amp;nbsp;:&lt;/p&gt;


&lt;pre&gt;# sendnews --help&lt;/pre&gt;


&lt;p&gt;Il reste pas mal de chose à faire pour que ce système d'envoi de newsletter soit quand même un peu plus complet&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gérer les bounces, c'est à dire les retours sur les adresses non valides (c'est un &quot;gros&quot; boulot)&lt;/li&gt;
&lt;li&gt;vérifier le mode silencieux (pour lancer le programme dans un cron)&lt;/li&gt;
&lt;li&gt;activer les erreurs et le log qui va avec&lt;/li&gt;
&lt;li&gt;utiliser PDO de PHP5 à la place de PEAR::DB&lt;/li&gt;
&lt;li&gt;faire un paquet tout en un avec &lt;a href=&quot;http://framework.zend.com/manual/fr/zend.mail.html&quot; hreflang=&quot;fr&quot;&gt;Zend_Mail&lt;/a&gt; et &lt;a href=&quot;http://framework.zend.com/manual/fr/zend.mime.html&quot; hreflang=&quot;fr&quot;&gt;Zend_Mime&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Enfin le code&amp;nbsp;!&lt;/h4&gt;


&lt;p&gt;Vous pouvez également &lt;a href=&quot;http://www.grafactory.net/dl/sendnews.tar.gz&quot; hreflang=&quot;fr&quot;&gt;télécharger directement le script&lt;/a&gt;&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#!/usr/bin/php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on supprime la limite d'execution d'un script php&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/set_time_limit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;set_time_limit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp;* Envoi d'une lettre d'information&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* PHP version 5&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* LICENSE: Ce programme est un logiciel libre distribue sous licence GNU/GPL&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* @author &amp;nbsp; &amp;nbsp; Yves Tannier &amp;lt;yves_chez_grafactory.net&amp;gt;&lt;br /&gt;
&amp;nbsp;* @copyright &amp;nbsp;2006 Yves Tannier&lt;br /&gt;
&amp;nbsp;* @license &amp;nbsp; &amp;nbsp;http://www.gnu.org/copyleft/lesser.html &amp;nbsp;LGPL License 2.1&lt;br /&gt;
&amp;nbsp;* @version &amp;nbsp; &amp;nbsp;0.1.0 &lt;br /&gt;
&amp;nbsp;* @link &amp;nbsp; &amp;nbsp; &amp;nbsp; http://www.grafactory.net&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp;* librairie Pear::DB&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'DB.php'&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp;* librairie Zend_Mail&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'Zend/Mail.php'&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$host&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// nom hote de la BDD&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$user&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;user&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// utilisateur&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$pass&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pass&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// mot de passetheatre&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$bdd&lt;/span&gt; &amp;nbsp;= &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;base&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// base de donnees&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$type&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;mysql&amp;quot;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// type de bdd&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// expediteur&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$sender&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;xxx@xxx.tld&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$sender_name&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;John Doe&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// adresse email du test par defaut&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_send&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;xxx@xxx.tld&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// sujet&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$subject&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Lettre hebdomadaire&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// pour les clients qui ne lise pas le html.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$msg_text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Si vous ne pouvez pas lire correctement ce message rendz-vous a l'adresse suivante...&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// repertoire de stockage des messages Html&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$dir_html&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/home/web/newsletter/date/&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_users&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;newsletter_abonnes&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// champs de la table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt; &amp;nbsp; &amp;nbsp; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt; &amp;nbsp;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// champ flag envoi OK&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$field_send&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;envoye&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// instruction WHERE si besoin (peut Ãªtre vid)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$where_more&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; AND thea=1 &amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// serveur smtp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$smtp_server&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// nombre d'envoi avant la pause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$per_send&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// duree de la pause en seconde&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$pause_time&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;15&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// aide contextuelle&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Parametres :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -s : mode silencieux (inactif)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -e : lancer l'envoi&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -r : remettre le flag envoye a null&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -t : envoyer un message de test&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -l : voir les erreurs (inactif)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -h, --help : cette aide...&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// recuperer les parametres passe en CLI&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-s'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$silent&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-e'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$execute&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-r'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$renew&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-t'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$testsend&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-l'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$viewlog&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'-h'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'--help'&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'SCRIPT_NAME'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;default&lt;/span&gt; :&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
Parametre inconnu : &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$param&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'argv'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
Veuillez preciser au moins un parametre&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$help_string&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* classe Zend_Mail modifiee pour ajouter &lt;br /&gt;
&amp;nbsp;* la methode de remise a zero du header 'To'&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; MyZend_Mail &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;extends&lt;/span&gt; Zend_Mail&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; removeAddTo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;_headers&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;To&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/array_splice&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array_splice&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;_recipients,&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// connection a la BDD&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$dsn&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$type://$user:$pass@$host/$bdd&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt; = DB::&lt;span style=&quot;color: #006600;&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$dsn&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setFetchMode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;DB_FETCHMODE_ASSOC&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// envoi&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$execute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// par cours du répertoire pour le dernier fichier place&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$dir&lt;/span&gt; = scandir&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$dir_html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$files&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$dir&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/preg_match&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_match&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'/^&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\.&lt;/span&gt;/'&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;$files&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'name'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;$files&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'date'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/filemtime&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;filemtime&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$dir_html&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_file&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$files&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'name'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on recupere le nom du fichier HTML&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$silent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/fwrite&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fwrite&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;STDOUT, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Entrez le nom precis du fichier html (defaut : &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_file&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) : &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$file_name&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/trim&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;trim&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/fgets&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fgets&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;STDIN&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$file_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;$file_name&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_file&lt;/span&gt;; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// le mail en html depuis la page html&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$handle&lt;/span&gt; = @&lt;a href=&quot;http://www.php.net/fopen&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fopen&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$dir_html&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$file_name&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$handle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/feof&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;feof&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$handle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;$msg_html&lt;/span&gt; .= &lt;a href=&quot;http://www.php.net/fgets&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fgets&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$handle&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;4096&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.php.net/fclose&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fclose&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$handle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Le fichier html du message n'a pas ete trouve ou n'a pas pu etre ouvert&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'Zend/Mail/Transport/Smtp.php'&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tr&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Mail_Transport_Smtp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$smtp_server&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// construction du message&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; MyZend_Mail&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setBodyText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$msg_text&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setBodyHtml&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$msg_html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setFrom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$sender&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$sender_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setSubject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$subject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on connecte&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tr&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// si ce n'est pas un test&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$testsend&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// requete&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$res&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;SELECT &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;,&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; FROM &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_users&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; WHERE 1 &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$where_more&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; AND &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$field_send&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;=0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// incrementation&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// &amp;nbsp;boucle&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$res&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;fetchRow&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// a qui envoye ?&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addTo&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// la pause (deconnection/reconnection)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; % &lt;span style=&quot;color: #0000ff;&quot;&gt;$per_send&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; == &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&amp;gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tr&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;disconnect&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$silent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;==============================&amp;gt; Pause au niveau &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$s&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #0000ff;&quot;&gt;$s&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$pause_time&lt;/span&gt;;&lt;span style=&quot;color: #0000ff;&quot;&gt;$s&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/sleep&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;sleep&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tr&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// envoi (manque le retour d'erreur)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;send&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$up&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;autoExecute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_users&lt;/span&gt;, &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$field_send&lt;/span&gt;=&amp;gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, DB_AUTOQUERY_UPDATE,&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;'='&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$silent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;-&amp;gt; Envoi en cours a &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Zend_Mail_Exception &lt;span style=&quot;color: #0000ff;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$e&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getTrace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;br /&gt;
&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// on supprime le mail dans les headers&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;removeAddTo&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$table_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'email'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;++;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// sinon on test l'envoi&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$silent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/fwrite&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fwrite&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;STDOUT, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Entrez l'adresse de test (par defaut : &amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_send&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) : &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_name&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/trim&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;trim&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/fgets&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fgets&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;STDIN&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_send&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$defaut_name&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// a qui envoye ?&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addTo&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&am