2012-10-16 07:44:31 +00:00
|
|
|
|
#!/usr/bin/php -c/var/www/batch/config/php_batch_sd.ini
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
include_once(FWK_PATH.'mail/sendMail.php');
|
|
|
|
|
|
|
|
|
|
$strInfoScript='Usage : '.basename($argv[0]). " <option>
|
|
|
|
|
Test le serveur de mail
|
|
|
|
|
|
|
|
|
|
Options :
|
|
|
|
|
-d Mode debug (Verbosite au maximum)
|
2013-06-19 08:24:49 +00:00
|
|
|
|
-n=XXX Nombre de mails <EFBFBD> envoyer
|
2012-10-16 07:44:31 +00:00
|
|
|
|
|
|
|
|
|
";
|
|
|
|
|
$nbTests=1;
|
|
|
|
|
|
|
|
|
|
//Initialistation des variables
|
|
|
|
|
$argv=$_SERVER['argv'];
|
2013-06-19 08:24:49 +00:00
|
|
|
|
//if ($_SERVER['argc']==1) die("Non g<>r<EFBFBD> pour l'instant : chargera les derniers fichiers EVEN non charg<72>s !".EOL);
|
2012-10-16 07:44:31 +00:00
|
|
|
|
/*echo "'".MODE_EXEC."'".EOL;
|
|
|
|
|
die();
|
|
|
|
|
*/
|
|
|
|
|
for ($i=1,$j=0; isset($argv[$i]); $i++) {
|
|
|
|
|
if (substr($argv[$i],0,1)=='-') {
|
|
|
|
|
switch (substr($argv[$i],1,1)) {
|
|
|
|
|
case 'd': $modeDebug=true; break;
|
|
|
|
|
case 'n': $nbTests=substr($argv[$i],3,strlen($argv[$i])-3)*1; break;
|
|
|
|
|
case '-':
|
|
|
|
|
case '?': die($strInfoScript); break;
|
|
|
|
|
default: die('Option '. $argv[$i] . " inconnue !\n");
|
|
|
|
|
}
|
|
|
|
|
} else $tabFichier[]=$argv[$i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo date ('Y/m/d - H:i:s') . " - Lancement de $nbTests test(s) d'envoi d'emails...".EOL;
|
|
|
|
|
|
|
|
|
|
for ($i=0; $i<$nbTests; $i++) {
|
2013-06-19 08:24:49 +00:00
|
|
|
|
$sujet ="Mail de test num<75>ro $i/$nbTests";
|
|
|
|
|
$message="Contenu du test num<75>ro $i/$nbTests";
|
2012-10-16 07:44:31 +00:00
|
|
|
|
echo date ('Y/m/d - H:i:s') . " - Envoi du $sujet ";
|
|
|
|
|
if (@sendMail('webmaster@scores-decisions.com', 'ylenaour@scores-decisions.com', $sujet, $message))
|
|
|
|
|
echo "ok.";
|
|
|
|
|
else
|
|
|
|
|
echo "ERREUR";
|
|
|
|
|
echo EOL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
die();
|
|
|
|
|
?>
|