From dcd06760cee3388a0e51ff3a344db31454d039cc Mon Sep 17 00:00:00 2001 From: Xephi Date: Wed, 9 Dec 2015 10:38:41 +0100 Subject: [PATCH] Display a message on bad email.html --- src/main/java/fr/xephi/authme/SendMailSSL.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/xephi/authme/SendMailSSL.java b/src/main/java/fr/xephi/authme/SendMailSSL.java index 8eb1a92be..12e0249b5 100644 --- a/src/main/java/fr/xephi/authme/SendMailSSL.java +++ b/src/main/java/fr/xephi/authme/SendMailSSL.java @@ -2,6 +2,8 @@ package fr.xephi.authme; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.settings.Settings; + +import org.apache.commons.mail.EmailException; import org.apache.commons.mail.HtmlEmail; import org.bukkit.Bukkit; @@ -81,8 +83,14 @@ public class SendMailSSL { ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail); } } - email.setHtmlMsg(content); - email.setTextMsg(content); + try { + email.setHtmlMsg(content); + email.setTextMsg(content); + } catch (EmailException e) + { + ConsoleLogger.showError("Your email.html config contains some error and cannot be send!"); + return; + } try { email.send(); } catch (Exception e) {