Index: main/plugin-newsletter/i18n/messages_en.xml
===================================================================
--- main/plugin-newsletter/i18n/messages_en.xml	(revision 38957)
+++ main/plugin-newsletter/i18n/messages_en.xml	(working copy)
@@ -277,6 +277,7 @@
 	<message key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA_INVALID">The characters you entered do not match the image word verification.<br/>Please try again.</message>
     <message key="NEWSLETTERS_SERVICE_INPUT_RECAPTCHA_INVALID">The captcha for human recognition is invalid</message>
 	<message key="NEWSLETTERS_SERVICE_EMAIL_ALREADY_EXISTS">This email address is already registered for this newsletter.</message>
+	<message key="NEWSLETTERS_SERVICE_EMAIL_SERVER_ERROR">An error occurred : the subscription was not saved. If the problem persists, please contact the administrator of the application.</message>
 	<message key="NEWSLETTERS_SERVICE_SELECT_CATEGORY">Select above the newsletters you wish to subscribe to.</message>
 	<message key="NEWSLETTERS_SERVICE_SUBCRIPTION_SUCCESS_SINGLE">The e-mail address <strong>"{0}"</strong> has been recorded for the newsletter "{1}".</message>
 	<message key="NEWSLETTERS_SERVICE_SUBCRIPTION_SUCCESS">The e-mail address <strong>"{0}"</strong> has been recorded for the following newsletters :</message>
Index: main/plugin-newsletter/i18n/messages_fr.xml
===================================================================
--- main/plugin-newsletter/i18n/messages_fr.xml	(revision 38957)
+++ main/plugin-newsletter/i18n/messages_fr.xml	(working copy)
@@ -277,6 +277,7 @@
 	<message key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA_INVALID">Les caractères que vous avez saisis ne correspondent pas à l'image de vérification des mots.<br/>Veuillez réessayer.</message>
     <message key="NEWSLETTERS_SERVICE_INPUT_RECAPTCHA_INVALID">Le captcha de reconnaissance humaine est invalide</message>
 	<message key="NEWSLETTERS_SERVICE_EMAIL_ALREADY_EXISTS">Cette adresse électronique est déjà enregistrée pour cette lettre d'information.</message>
+	<message key="NEWSLETTERS_SERVICE_EMAIL_SERVER_ERROR">Une erreur s'est produite : l'abonnement n'a pas été prise en compte. Si le problème persiste, veuillez contacter l'administrateur de l'application.</message>
 	<message key="NEWSLETTERS_SERVICE_SELECT_CATEGORY">Sélectionnez ci-dessus la ou les lettres d'information auxquelles vous souhaitez vous abonner.</message>
 	<message key="NEWSLETTERS_SERVICE_SUBCRIPTION_SUCCESS_SINGLE">L'adresse électronique <strong>"{0}"</strong> a bien été enregistrée pour la lettre d'information "{1}".</message>
 	<message key="NEWSLETTERS_SERVICE_SUBCRIPTION_SUCCESS">L'adresse électronique <strong>"{0}"</strong> a bien été enregistrée pour les lettres d'information suivantes :</message>
Index: main/plugin-newsletter/pages/services/subscribe/subscribe.xsl
===================================================================
--- main/plugin-newsletter/pages/services/subscribe/subscribe.xsl	(revision 38957)
+++ main/plugin-newsletter/pages/services/subscribe/subscribe.xsl	(working copy)
@@ -52,6 +52,9 @@
 						<xsl:when test="FormResult/msg = 'success'">
 							<xsl:call-template name="success"/>
 						</xsl:when>
+						<xsl:when test="FormResult/msg = 'failure'">
+                            <xsl:call-template name="failure"/>
+                        </xsl:when>
 						<xsl:otherwise>
 							<!-- Form -->
 							<xsl:call-template name="subscribe-form"/>
@@ -91,6 +94,13 @@
 		</div>
 	</xsl:template>
 	
+	<!-- Template to display the server error message -->
+    <xsl:template name="failure">
+        <div class="error">
+            <p><i18n:text i18n:key="NEWSLETTERS_SERVICE_EMAIL_SERVER_ERROR"/></p>
+        </div>
+    </xsl:template>
+	
 	<!-- NOT USED.  -->
 	<xsl:template name="success-multiple">
 		<div class="info">
Index: main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl
===================================================================
--- main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl	(revision 38957)
+++ main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl	(working copy)
@@ -66,6 +66,9 @@
             <xsl:when test="/NewsletterService/FormResult/msg = 'success'">
                 <xsl:call-template name="success"/>
             </xsl:when>
+            <xsl:when test="/NewsletterService/FormResult/msg = 'failure'">
+                <xsl:call-template name="failure"/>
+            </xsl:when>
             <xsl:otherwise>
                 <!-- Form -->
                 <xsl:call-template name="subscribe-form"/>
@@ -101,6 +104,13 @@
 		</div>
 	</xsl:template>
 	
+	<!-- Template to display the server error message -->
+    <xsl:template name="failure">
+        <div class="error">
+            <p><i18n:text i18n:key="NEWSLETTERS_SERVICE_EMAIL_SERVER_ERROR"/></p>
+        </div>
+    </xsl:template>
+	
 	<!-- NOT USED.  -->
 	<xsl:template name="success-multiple">
 		<div class="info">
Index: main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java
===================================================================
--- main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java	(revision 38957)
+++ main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java	(working copy)
@@ -93,96 +93,104 @@
 
         if (subscribe)
         {
-            String siteName = request.getParameter("siteName");
-            String[] categories = request.getParameterValues("category");
-            
-            // Validate email
-            if (!_validEmail(email))
-            {
-                result.put("msg", "invalid-email");
-                return result;
-            }
-            
-            Page page = _resolver.resolveById(request.getParameter("page-id"));
-            if (_pageHelper.isCaptchaRequired(page))
+            try
             {
-                String captchaKey = request.getParameter("captcha-key");
-                String answer = request.getParameter("captcha");
-    
-                // Validate captcha 
-                if (!CaptchaHelper.checkAndInvalidate(captchaKey, answer))
+                String siteName = request.getParameter("siteName");
+                String[] categories = request.getParameterValues("category");
+                
+                // Validate email
+                if (!_validEmail(email))
                 {
-                    result.put("msg", "invalid-captcha");
+                    result.put("msg", "invalid-email");
                     return result;
                 }
-            }
-            
-            // Validate categories
-            if (!_validCategory(categories))
-            {
-                result.put("msg", "invalid-category");
-                return result;
-            }
-            
-            
-            List<String> subscribeTo = new ArrayList<>();
-            List<String> alreadySubscribeTo = new ArrayList<>();
-            for (String categoryID : categories)
-            {
-                if (_subscribersDao.getSubscriber(email, siteName, categoryID) == null)
+                
+                Page page = _resolver.resolveById(request.getParameter("page-id"));
+                if (_pageHelper.isCaptchaRequired(page))
                 {
-                    Category category = _getCategory(categoryID);
-                    if (category != null)
+                    String captchaKey = request.getParameter("captcha-key");
+                    String answer = request.getParameter("captcha");
+        
+                    // Validate captcha 
+                    if (!CaptchaHelper.checkAndInvalidate(captchaKey, answer))
                     {
-                        Subscriber subscriber = new Subscriber();
-                        subscriber.setEmail(email);
-                        subscriber.setSiteName(siteName);
-                        subscriber.setCategoryId(categoryID);
-                        subscriber.setSubscribedAt(new Date());
-                        
-                        // Generate unique token
-                        String token = UUID.randomUUID().toString();
-                        subscriber.setToken(token);
-                        
-                        _subscribersDao.subscribe(subscriber);
-                        
-                        getLogger().info("The user with email '" + email + "' subscribed to the newsletter with the token " + token);
-                        
-                        subscribeTo.add(categoryID);
+                        result.put("msg", "invalid-captcha");
+                        return result;
                     }
                 }
-                else
+                
+                // Validate categories
+                if (!_validCategory(categories))
                 {
-                    alreadySubscribeTo.add(categoryID);
+                    result.put("msg", "invalid-category");
+                    return result;
                 }
-            }
-            
-            result.put("msg", "success");
-            String ids = "";
-            int i = 0;
-            for (String id : subscribeTo)
-            {
-                if (i != 0)
+                
+                
+                List<String> subscribeTo = new ArrayList<>();
+                List<String> alreadySubscribeTo = new ArrayList<>();
+                for (String categoryID : categories)
                 {
-                    ids += ",";
+                    if (_subscribersDao.getSubscriber(email, siteName, categoryID) == null)
+                    {
+                        Category category = _getCategory(categoryID);
+                        if (category != null)
+                        {
+                            Subscriber subscriber = new Subscriber();
+                            subscriber.setEmail(email);
+                            subscriber.setSiteName(siteName);
+                            subscriber.setCategoryId(categoryID);
+                            subscriber.setSubscribedAt(new Date());
+                            
+                            // Generate unique token
+                            String token = UUID.randomUUID().toString();
+                            subscriber.setToken(token);
+                            
+                            _subscribersDao.subscribe(subscriber);
+                            
+                            getLogger().info("The user with email '" + email + "' subscribed to the newsletter with the token " + token);
+                            
+                            subscribeTo.add(categoryID);
+                        }
+                    }
+                    else
+                    {
+                        alreadySubscribeTo.add(categoryID);
+                    }
                 }
-                ids += id;
-                i++;
-            }
-            result.put("subscribeTo", ids);
-            
-            ids = "";
-            i = 0;
-            for (String id : alreadySubscribeTo)
-            {
-                if (i != 0)
+                
+                result.put("msg", "success");
+                String ids = "";
+                int i = 0;
+                for (String id : subscribeTo)
+                {
+                    if (i != 0)
+                    {
+                        ids += ",";
+                    }
+                    ids += id;
+                    i++;
+                }
+                result.put("subscribeTo", ids);
+                
+                ids = "";
+                i = 0;
+                for (String id : alreadySubscribeTo)
                 {
-                    ids += ",";
+                    if (i != 0)
+                    {
+                        ids += ",";
+                    }
+                    ids += id;
+                    i++;
                 }
-                ids += id;
-                i++;
+                result.put("alreadySubscribeTo", ids);
             }
-            result.put("alreadySubscribeTo", ids);
+            catch (Exception e)
+            {
+                result.put("msg", "failure");
+                getLogger().error("An error occurred during the subscription for the email '" + email + "'", e);
+            }
         }
         return result;
     }
