Index: /extensions/Mail_supervisor/admin/mail_superv_admin.php
===================================================================
--- /extensions/Mail_supervisor/admin/mail_superv_admin.php	(revision 4053)
+++ /extensions/Mail_supervisor/admin/mail_superv_admin.php	(revision 4054)
@@ -30,12 +30,14 @@
 
 
-global $user, $lang, $conf, $errors;
+
+
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+global $user, $lang, $conf, $errors,$mails_données;
 global $args, $conf_mail,$infos_message,$erreur_message ;
-
- load_language('plugin.lang', MAIL_SUPERV_PATH);
-// +-----------------------------------------------------------------------+
-// | Check Access and exit when user status is not ok                      |
-// +-----------------------------------------------------------------------+
-check_status(ACCESS_ADMINISTRATOR);
 
 include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
@@ -50,5 +52,6 @@
 
 
-
+ load_language('plugin.lang', MAIL_SUPERV_PATH);
+ 
 $mails_options = explode("," , $conf['mail_superv']);
 $mails_données=Get_Datas();
@@ -211,6 +214,6 @@
 		;';
   		list($group_name) = mysql_fetch_row(pwg_query($query));
-		 
-		 
+		}	else {
+				$group_name="";		 
 		}		
 //================================================
@@ -219,5 +222,5 @@
 	
 if ( isset($_POST['test_envoie']) ) {
-	if ($group_id >= 0) {
+	
 		$mails_données['message_test'] = isset($_POST['content']) ? $_POST['content'] :  $mails_données['message_test']  ;
 		$message=$mails_données['message_test'];
@@ -225,5 +228,5 @@
 	 	test_envoie($message,$group_name,$group_id);   
 		$mails_données = Get_Datas() ;
-	}	
+		
   } 
 
Index: /extensions/Mail_supervisor/include/fonctions.php
===================================================================
--- /extensions/Mail_supervisor/include/fonctions.php	(revision 4053)
+++ /extensions/Mail_supervisor/include/fonctions.php	(revision 4054)
@@ -186,18 +186,17 @@
 //===============================================
 
-function corrige_header($Carbonne,$headers)
+function corrige_header($Carbonne,$headers,$args)
 	{
-	global $mails_options,$conf_mail,$mailto,$args,$infos_message;
- 
-	if (!empty($args[$Carbonne]))
+	global $mails_options,$conf_mail,$mailto,$infos_message;
+
+ if (!empty($args[$Carbonne]))
 	 {
  
 	 	if ( count($args[$Carbonne]) > 0 ) 
 		{
-		  if ($mails_options[1] == 'on') {
-		  // Correction "< >"
-			$list_mail  = get_strict_email_list(implode(',', $args[$Carbonne])) ;
- 			$headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.' : '.$list_mail."\n", $headers);
-			}
+		 if ($mails_options[1] == 'on') {
+			$list_mail  = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ;
+ 			$headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers);
+		 }
 		}
 	} else {
@@ -207,5 +206,4 @@
 		
 		
- 
 return $headers;
 
@@ -259,4 +257,7 @@
 function vérif_base()
 {
+
+global $lang;
+ load_language('plugin.lang', MAIL_SUPERV_PATH);
 
 $q = "
@@ -393,4 +394,6 @@
  	} 
 }
+
+
 function Get_colonnes_de($table)
 {
Index: /extensions/Mail_supervisor/include/function_test_send.php
===================================================================
--- /extensions/Mail_supervisor/include/function_test_send.php	(revision 4053)
+++ /extensions/Mail_supervisor/include/function_test_send.php	(revision 4054)
@@ -31,8 +31,9 @@
 function test_envoie($message,$group_name,$group_id)
 {
-    global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$args ;
+    global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$args,$lang ;
 	$mailto="";  
 	
-
+ load_language('plugin.lang', MAIL_SUPERV_PATH);
+ 
 //==================================================================================
 if (!isset($infos_message))
@@ -69,6 +70,9 @@
   if (count($groups) > 0)
   {
- //===========================================================
-  	$args['Bcc']=$groups;
+       $args['Bcc']=$groups;
+   }   else {
+       $mailto = $conf_mail['formated_email_webmaster']; 
+   } 
+   
 	$args['from'] = $conf_mail['formated_email_webmaster'];
 	//==================================================================
@@ -88,11 +92,18 @@
     	$args['subject']="Plugin Piwigo TEST";
     	$args['content']=$message_html;
+		$infos_message .="To :" . $mailto;
+		
         $ret= pwg_mail($mailto , $args); 
-		
-		 $infos_message .=    sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />';
-
+	if ( $group_name <> '' or $mailto <> '' )
+	{	
+		if ($group_name<>'') {
+		 $infos_message .=  '<br />'.  sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />';
+		 	}
+		 	if ($mailto <> '') {
+		 		$infos_message .=  '<br />'.  sprintf( l10n('mail_sent_to'), $mailto ).'<br />';
+		 		}
 		 
 	}else{
-	       $infos_message .=l10n('no_receiver_available') ;
+	       $infos_message .='<br />'.l10n('no_receiver_available') ;
 	}
 	
@@ -101,5 +112,5 @@
 function mail_attachement($args)
 {
- global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données ;
+ global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$lang ;
 
     $mails_données = Get_Datas();
@@ -109,5 +120,5 @@
   }
 
-
+ load_language('plugin.lang', MAIL_SUPERV_PATH);
 
   		$nom ='piwigo_logo_sombre_214x100.png'; 
Index: /extensions/Mail_supervisor/main.inc.php
===================================================================
--- /extensions/Mail_supervisor/main.inc.php	(revision 4053)
+++ /extensions/Mail_supervisor/main.inc.php	(revision 4054)
@@ -24,5 +24,5 @@
 /*
 Plugin Name: Mail supervisor
-Version: 1.1.5
+Version: 1.1.6
 Description:  Mail supervisor surveille l'envoie des mails. 
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315
@@ -117,17 +117,17 @@
 	}else{
    
-		if (!empty($args['Cc']))
+  
+     }
+
+//=============================================================================		
+if (!empty($args['Cc']))
   			{
-    			 $headers= corrige_header('Cc',$headers);
-				 
+    			 $headers= corrige_header('Cc',$headers,$args);
   			}
   		if (!empty($args['Bcc']))
   			{   
-		   		   $headers	= corrige_header('Bcc',$headers); 
-			}
-
-  
-     }
-
+		   		   $headers	= corrige_header('Bcc',$headers,$args); 
+			}
+//=============================================================================			
 if ($mails_options[2]=='on')   {
 
@@ -152,8 +152,5 @@
 		 if ($nb_destinataires > 0) {
    	           $ret = mail($mailto, $subject, $content, $headers);
-/* <br />
-<b>Warning</b>:  mail() [<a href='function.mail'>function.mail</a>]: Trop de spam. Fonction mail() bloque.
- in <b>/mnt/102/sdb/9/5/cl.josse/Galerie/plugins/mail_supervisor/main.inc.php</b> on line <b>132</b><br />
-*/
+
 			}else{
 			   $message .='Nombre de destinataires = 0';
Index: /extensions/Mail_supervisor/maintain.inc.php
===================================================================
--- /extensions/Mail_supervisor/maintain.inc.php	(revision 4053)
+++ /extensions/Mail_supervisor/maintain.inc.php	(revision 4054)
@@ -31,5 +31,5 @@
 
 include_once (MAIL_SUPERV_PATH.'include/constants.php');
-global $lang;
+
 include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
 
@@ -41,5 +41,5 @@
   SELECT  count(`id`) as total   FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail"   ;';
      $plugs = mysql_fetch_array(pwg_query($q));
- $nb= $plugs['total'];
+	 $nb= $plugs['total'];
 
   if (count($nb)>=1) { 
