mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
fix sending email to an unauthenticated smtp server
This commit is contained in:
parent
4cf1f29e0a
commit
fdb95484c1
@ -75,10 +75,13 @@ public class EmailUtil {
|
||||
email.setCharset("UTF-8");
|
||||
email.setHostName(ConfigUtil.getConfigStringValue(ConfigType.SMTP_HOSTNAME));
|
||||
email.setSmtpPort(ConfigUtil.getConfigIntegerValue(ConfigType.SMTP_PORT));
|
||||
email.setAuthentication(ConfigUtil.getConfigStringValue(ConfigType.SMTP_USERNAME),
|
||||
ConfigUtil.getConfigStringValue(ConfigType.SMTP_PASSWORD));
|
||||
email.addTo(recipientUser.getEmail(), recipientUser.getUsername());
|
||||
ConfigDao configDao = new ConfigDao();
|
||||
Config usernameConfig = configDao.getById(ConfigType.SMTP_USERNAME);
|
||||
Config passwordConfig = configDao.getById(ConfigType.SMTP_PASSWORD);
|
||||
if (usernameConfig != null && passwordConfig != null) {
|
||||
email.setAuthentication(usernameConfig.getValue(), passwordConfig.getValue());
|
||||
}
|
||||
email.addTo(recipientUser.getEmail(), recipientUser.getUsername());
|
||||
Config themeConfig = configDao.getById(ConfigType.THEME);
|
||||
String appName = "Sismics Docs";
|
||||
if (themeConfig != null) {
|
||||
|
@ -2,4 +2,5 @@ email.template.password_recovery.subject=Please reset your password
|
||||
email.template.password_recovery.hello=Hello {0}.
|
||||
email.template.password_recovery.instruction1=We have received a request to reset your password.<br/>If you did not request help, then feel free to ignore this email.
|
||||
email.template.password_recovery.instruction2=To reset your password, please visit the link below:
|
||||
email.template.password_recovery.click_here=Click here to reset your password
|
||||
email.template.password_recovery.click_here=Click here to reset your password
|
||||
email.no_html.error=Your email client does not support HTML messages
|
@ -2,4 +2,5 @@ email.template.password_recovery.subject=R
|
||||
email.template.password_recovery.hello=Bonjour {0}.
|
||||
email.template.password_recovery.instruction1=Nous avons reçu une demande de réinitialisation de mot de passe.<br/>Si vous n''avez rien demandé, vous pouvez ignorer cet mail.
|
||||
email.template.password_recovery.instruction2=Pour réinitialiser votre mot de passe, cliquez sur le lien ci-dessous :
|
||||
email.template.password_recovery.click_here=Cliquez ici pour réinitialiser votre mot de passe.
|
||||
email.template.password_recovery.click_here=Cliquez ici pour réinitialiser votre mot de passe.
|
||||
email.no_html.error=Votre client mail ne supporte pas les messages au format HTML
|
Loading…
Reference in New Issue
Block a user