Index: /trunk/admin/notification_by_mail.php
===================================================================
--- /trunk/admin/notification_by_mail.php	(revision 1817)
+++ /trunk/admin/notification_by_mail.php	(revision 1818)
@@ -227,9 +227,4 @@
     $is_action_send = ($action == 'send');
 
-    if (!isset($customize_mail_content))
-    {
-      $customize_mail_content = $conf['nbm_complementary_mail_content'];
-    }
-
     // disabled and null mail_address are not selected in the list
     $data_users = get_user_notifications('send', $check_key_list);
@@ -244,4 +239,16 @@
       {
         $datas = array();
+
+        if (!isset($customize_mail_content))
+        {
+          $customize_mail_content = $conf['nbm_complementary_mail_content'];
+        }
+
+        if ($conf['nbm_send_html_mail'] and !(strpos($customize_mail_content, '<') === 0))
+        {
+          // On HTML mail, detects if the content are HTML format.
+          // If it's plain text format, convert content to readable HTML
+          $customize_mail_content = nl2br(htmlentities($customize_mail_content));
+        }
 
         // Prepare message after change language
Index: /trunk/include/functions_mail.inc.php
===================================================================
--- /trunk/include/functions_mail.inc.php	(revision 1817)
+++ /trunk/include/functions_mail.inc.php	(revision 1818)
@@ -4,5 +4,5 @@
 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net              |
+// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net         |
 // +-----------------------------------------------------------------------+
 // | branch        : BSF (Best So Far)
@@ -27,10 +27,4 @@
 // +-----------------------------------------------------------------------+
 
-/**
- * - Extract mail fonctions of password.php
- * - Modify pwg_mail (add pararameters + news fonctionnalities)
- * - Var conf_mail, function get_mail_configuration, format_email, pwg_mail
- */
-
 // +-----------------------------------------------------------------------+
 // |                               functions                               |
@@ -100,5 +94,5 @@
 
 /**
- * Return an completed array template/theme
+ * Returns an completed array template/theme
  * completed with $conf['default_template']
  *
@@ -162,4 +156,45 @@
 
 /**
+ * Returns email of all administrator
+ *
+ * @return string
+ */
+function get_administrators_email()
+{
+  global $conf;
+
+  $result = array();
+
+  $query = '
+select
+  U.'.$conf['user_fields']['username'].' as username,
+  U.'.$conf['user_fields']['email'].' as mail_address
+from
+  '.USERS_TABLE.' as U,
+  '.USER_INFOS_TABLE.' as I
+where
+  I.user_id =  U.'.$conf['user_fields']['id'].' and
+  I.status in (\'webmaster\',  \'admin\') and
+  '.$conf['user_fields']['email'].' is not null
+order by
+  username
+';
+
+  $datas = pwg_query($query);
+  if (!empty($datas))
+  {
+    while ($admin = mysql_fetch_array($datas))
+    {
+      if (!empty($admin['mail_address']))
+      {
+        array_push($result, format_email($admin['username'], $admin['mail_address']));
+      }
+    }
+  }
+
+  return $result;
+}
+
+/**
  * sends an email, using PhpWebGallery specific informations
  *
@@ -168,4 +203,6 @@
  *   - args: function params of mail function:
  *       o from: sender [default value webmaster email]
+ *       o Cc: array of carbon copy receivers of the mail. [default value empty]
+ *       o Bcc: array of blind carbon copy receivers of the mail. [default value empty]
  *       o subject  [default value 'PhpWebGallery']
  *       o content: content of mail    [default value '']
@@ -175,5 +212,4 @@
  *       o theme: template to use [default $conf['default_template']]
  */
-//function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $infos_format = 'text/plain', $email_format = null)
 function pwg_mail($to, $args = array())
 {
@@ -223,4 +259,9 @@
   }
 
+  if ($conf_mail['send_bcc_mail_webmaster'])
+  {
+    $args['Bcc'][] = $conf_mail['formated_email_webmaster'];
+  }
+
   if (($args['content_format'] == 'text/html') and ($args['email_format'] == 'text/plain'))
   {
@@ -233,13 +274,19 @@
   $headers = 'From: '.$args['from']."\n";
   $headers.= 'Reply-To: '.$args['from']."\n";
+
+  if (!empty($args['Cc']))
+  {
+    $headers.= 'Cc: '.implode(',', $args['Cc'])."\n";
+  }
+
+  if (!empty($args['Bcc']))
+  {
+    $headers.= 'Bcc: '.implode(',', $args['Bcc'])."\n";
+  }
+
   $headers.= 'Content-Type: multipart/alternative;'."\n";
   $headers.= '  boundary="---='.$conf_mail['boundary_key'].'";'."\n";
   $headers.= '  reply-type=original'."\n";
   $headers.= 'MIME-Version: 1.0'."\n";
-
-  if ($conf_mail['send_bcc_mail_webmaster'])
-  {
-    $headers.= 'Bcc: '.$conf_mail['formated_email_webmaster']."\n";
-  }
 
   $content = '';
Index: /trunk/include/picture_comment.inc.php
===================================================================
--- /trunk/include/picture_comment.inc.php	(revision 1817)
+++ /trunk/include/picture_comment.inc.php	(revision 1818)
@@ -210,4 +210,5 @@
       include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
 
+      $val_url = get_absolute_root_url().'comments.php?validate='.$comm['id'];
       $del_url = get_absolute_root_url().'comments.php?delete='.$comm['id'];
 
@@ -217,4 +218,5 @@
         .'IP: '.$comm['ip']."\n"
         .'Browser: '.$comm['agent']."\n\n"
+        .'Validate: '.$val_url."\n"
         .'Delete: '.$del_url."\n";
       if ($comment_action!='validate')
@@ -224,6 +226,14 @@
           .'comments.php?validate='.$comm['id'];
       }
-      pwg_mail(get_webmaster_mail_address(),
-        array('subject' => 'PWG comment by '.$comm['author'], 'content' => $content));
+      pwg_mail
+      (
+        format_email('administrators', get_webmaster_mail_address()),
+        array
+        (
+          'subject' => 'PWG comment by '.$comm['author'], 
+          'content' => $content,
+          'Bcc' => get_administrators_email()
+        )
+      );
     }
   }
Index: /trunk/register.php
===================================================================
--- /trunk/register.php	(revision 1817)
+++ /trunk/register.php	(revision 1818)
@@ -71,9 +71,12 @@
         .l10n('admin').': '.$admin_url;
 
-      pwg_mail(get_webmaster_mail_address(),
+      pwg_mail
+      (
+        format_email('administrators', get_webmaster_mail_address()),
         array
         (
           'subject' => 'PWG '.l10n('register_title').' '.$username,
-          'content' => $content
+          'content' => $content,
+          'Bcc' => get_administrators_email()
         )
       );
