Index: /extensions/Piwecard/admin/admin_management.php
===================================================================
--- /extensions/Piwecard/admin/admin_management.php	(revision 20283)
+++ /extensions/Piwecard/admin/admin_management.php	(revision 20284)
@@ -134,7 +134,15 @@
 }
 
-$nb_ecard_valid_total = str_replace(array('%nb_valid%', '%nb_total%'), array($piwecard->get_nb_valid_ecard(), $piwecard->get_nb_ecard()), l10n('piwecard_nb_ecard_valid_total'));
+$nb_ecards_valid_total = str_replace(array('%nb_valid%', '%nb_total%'), array($piwecard->get_nb_valid_ecard(), $piwecard->get_nb_ecard()), l10n('piwecard_nb_ecard_valid_total'));
 
-$template->assign('nb_ecard_valid_total', $nb_ecard_valid_total);
+$query = 'SELECT COUNT(DISTINCT sender_email) AS nb_senders, COUNT(DISTINCT recipient_email) AS nb_recipients FROM '.PIWECARD_TABLE.' ORDER BY date_creation;';
+$result = pwg_db_fetch_assoc(pwg_query($query));
+$nb_distinct_senders_total = (empty($result['nb_senders']) ? 0 : $result['nb_senders']);
+$nb_distinct_recipients_total = (empty($result['nb_recipients']) ? 0 : $result['nb_recipients']);
+
+$nb_distinct_senders_recipients_total = str_replace(array('%nb_senders%', '%nb_recipients%'), array($nb_distinct_senders_total, $nb_distinct_senders_total), l10n('piwecard_nb_sender_recipient_total'));
+
+$template->assign('nb_ecards_valid_total', $nb_ecards_valid_total);
+$template->assign('nb_distinct_senders_recipients_total', $nb_distinct_senders_recipients_total);
 $template->assign('ecard_nb_ecard_page', $piwecard->config['nb_ecard_page']);
 $template->assign('navbar', $ecard_navbar);
Index: /extensions/Piwecard/admin/template/admin_configuration.tpl
===================================================================
--- /extensions/Piwecard/admin/template/admin_configuration.tpl	(revision 20283)
+++ /extensions/Piwecard/admin/template/admin_configuration.tpl	(revision 20284)
@@ -222,8 +222,10 @@
 			<div class="ecard_form_line ecard_email_config">
 				<label for="ecard_email_message_text">{'piwecard_email_message_text'|@translate}*</label><span class="ecard_error" id="ecard_email_message_text_error" style="{$ecard_errors.email_message.text.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
+				(<a href="#" id="showPreviewTextMessage" title="{'piwecard_preview'|@translate}">{'piwecard_preview'|@translate}</a>)
 				<textarea name="ecard_email_message_text" id="ecard_email_message_text" {$ecard_errors.email_message.text.style_error_input}>{$ecard_email_message_text}</textarea>
 			</div>
 			<div class="ecard_form_line ecard_email_config">
 				<label for="ecard_email_message_html">{'piwecard_email_message_html'|@translate}*</label><span class="ecard_error" id="ecard_email_message_html_error" style="{$ecard_errors.email_message.html.style_error_text}"> {'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
+				(<a href="#" id="showPreviewHTMLMessage" title="{'piwecard_preview'|@translate}">{'piwecard_preview'|@translate}</a>)
 				<textarea name="ecard_email_message_html" id="ecard_email_message_html" {$ecard_errors.email_message.html.style_error_input}>{$ecard_email_message_html}</textarea>
 			</div>
Index: /extensions/Piwecard/admin/template/admin_management.tpl
===================================================================
--- /extensions/Piwecard/admin/template/admin_management.tpl	(revision 20283)
+++ /extensions/Piwecard/admin/template/admin_management.tpl	(revision 20284)
@@ -21,5 +21,5 @@
 		<legend>{'piwecard_list'|@translate}</legend>
 		<div class="ecard_last_line">
-			{$nb_ecard_valid_total}
+			{$nb_ecards_valid_total}  ({$nb_distinct_senders_recipients_total})
 		</div>
 	</fieldset>
Index: /extensions/Piwecard/include/piwecard.class.php
===================================================================
--- /extensions/Piwecard/include/piwecard.class.php	(revision 20283)
+++ /extensions/Piwecard/include/piwecard.class.php	(revision 20284)
@@ -415,9 +415,9 @@
 	//Send an email
 	function mail($email_infos) {
-		global $conf, $page, $lang_info;
+		global $lang_info;
 		$template_mail = new Template(PIWECARD_MAIL_PATH.'template');
 		$smarty = $template_mail->smarty;
 		
-		$from = $email_infos['from_name']." <".$email_infos['from_email'].">";
+		$from = '"'.$email_infos['from_name'].'" <'.$email_infos['from_email'].'>';
 		$subject = encode_mime_header(trim(preg_replace('#[\n\r]+#s', '', $email_infos['subject'])));
 		$boundary = '_----------='.md5(uniqid(mt_rand()));
@@ -436,14 +436,7 @@
 		
 		if (empty($email_infos['message']['html'])) {		//Text plain email
+			$headers .= 'Content-Type: text/plain; charset="'.get_pwg_charset().'"'."\n";
 			$headers .= 'Content-Transfer-Encoding: 8bit'."\n";
-			$message .= $email_infos['message']['text'];
-			$smarty->assign(array(
-									'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'],
-									'GALLERY_URL' => get_absolute_root_url(),
-									'MAIL' => get_webmaster_mail_address(),
-								)
-			);
-			$message .= $smarty->fetch('mail_text.tpl');
-			$message = utf8_decode($message);
+			$message = $this->get_text_message($email_infos['message']['text'], $smarty);
 		} else {
 			$headers .= 'MIME-Version: 1.0'."\n";
@@ -453,18 +446,10 @@
 			$message .= 'Content-Type: text/plain; charset="'.get_pwg_charset().'"'."\n";
 			$message .= 'Content-Transfer-Encoding: binary'."\n\n";
-			$message .= $email_infos['message']['text']."\n\n";
+			$message .= $this->get_text_message($email_infos['message']['text'], $smarty);
+			$message .= "\n\n";
 			$message .= '--'.$boundary."\n";
 			$message .= 'Content-Type: text/html; charset="'.get_pwg_charset().'"'."\n";
 			$message .= 'Content-Transfer-Encoding: binary;'."\n\n";
-			$smarty->assign(array(
-									'CONTENT_ENCODING' => get_pwg_charset(),
-									'GALLERY_URL' => get_absolute_root_url(),
-									'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'],
-									'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
-									'MAIL' => get_webmaster_mail_address(),
-									'MESSAGE_HTML' => $email_infos['message']['html'],
-								)
-			);
-			$message .= $smarty->fetch('mail_html.tpl');
+			$message .= $this->get_html_message($email_infos['message']['html'], $smarty);
 			$message .= "\n\n";
 			$message .= '--'.$boundary."--\n";
@@ -473,4 +458,36 @@
 		mail($email_infos['to'], $subject, $message, $headers);
 	}
+	
+	function get_text_message($message_text, $smarty) {
+		global $page, $conf;
+		
+		$message = $message_text;
+		$smarty->assign(array(
+								'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'],
+								'GALLERY_URL' => get_absolute_root_url(),
+								'MAIL' => get_webmaster_mail_address(),
+							)
+		);
+		$message .= $smarty->fetch('mail_text.tpl');
+		
+		return $message;
+	}
+	
+	function get_html_message($message_html, $smarty) {
+		global $page, $conf;
+		
+		$smarty->assign(array(
+								'CONTENT_ENCODING' => get_pwg_charset(),
+								'GALLERY_URL' => get_absolute_root_url(),
+								'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'],
+								'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
+								'MAIL' => get_webmaster_mail_address(),
+								'MESSAGE_HTML' => $message_html,
+							)
+		);
+		$message = $smarty->fetch('mail_html.tpl');
+		
+		return $message;
+	}
 }
 ?>
Index: /extensions/Piwecard/install/default_values.inc.php
===================================================================
--- /extensions/Piwecard/install/default_values.inc.php	(revision 20283)
+++ /extensions/Piwecard/install/default_values.inc.php	(revision 20284)
@@ -16,5 +16,5 @@
 							'display' 	=> false,
 							'style'		=> 'solid',
-							'width'		=> '10px',
+							'width'		=> '5px',
 							'color'		=> 'FFFFFF',
 );
Index: /extensions/Piwecard/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 20283)
+++ /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 20284)
@@ -70,4 +70,5 @@
 $lang['piwecard_list'] 							= 'List of e-cards';
 $lang['piwecard_nb_ecard_valid_total'] 			= '%nb_valid% valid e-cards out of %nb_total% e-cards';
+$lang['piwecard_nb_sender_recipient_total'] 	= '%nb_senders% unique senders and %nb_recipients% unique recipients';
 $lang['piwecard_valid']							= 'Valid';
 $lang['piwecard_invalid']						= 'Expired';
Index: /extensions/Piwecard/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 20283)
+++ /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 20284)
@@ -70,4 +70,5 @@
 $lang['piwecard_list'] = 'Liste des cartes virtuelles';
 $lang['piwecard_nb_ecard_valid_total'] = '%nb_valid% cartes virtuelles valides sur %nb_total% cartes virtuelles';
+$lang['piwecard_nb_sender_recipient_total'] = '%nb_senders% expéditeurs uniques et %nb_recipients% destinataires uniques';
 $lang['piwecard_valid']	= 'Valides';
 $lang['piwecard_invalid'] = 'Périmées';
