Improve message for SMTP server not configured.

This commit is contained in:
Paulo Gustavo Veiga 2012-06-30 19:16:18 -03:00
parent 538e0196e2
commit cd46647602
2 changed files with 25 additions and 13 deletions

View File

@ -117,6 +117,7 @@ final public class NotificationService {
}
private void handleException(Exception e) {
System.err.println("An expected error has occurred trying to send an email notification. Usually, the main reason for this is that the SMTP server properties has not been configured properly. Edit the WEB-INF/app.properties file and verify the SMTP server configuration properties.");
e.printStackTrace();
}
@ -136,12 +137,16 @@ final public class NotificationService {
}
public void sendRegistrationEmail(@NotNull User user) {
try {
final Map<String, Object> model = new HashMap<String, Object>();
model.put("user", user);
final String activationUrl = "http://wisemapping.com/c/activation?code=" + user.getActivationCode();
model.put("emailcheck", activationUrl);
mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "Welcome to Wisemapping!", model,
"confirmationMail.vm");
} catch (Exception e) {
handleException(e);
}
}
public void reportMindmapEditorError(@NotNull MindMap mindmap, @NotNull User user, @NotNull String userAgent, @Nullable String jsErrorMsg) {

View File

@ -24,6 +24,13 @@ database.password=
#------------------------
# Plain SMTP Server Configuration
#------------------------
mail.smtp.port=465
mail.smtp.host=localhost
mail.username=root
mail.password=
mail.smtp.auth=false
mail.smtp.starttls.enable=false
mail.smtp.quitwait=false
#------------------------
# SSL SMTP Server Configuration
@ -32,13 +39,13 @@ database.password=
#------------------------
# GMAIL SMTP Configuration
#------------------------
mail.smtp.port=587
mail.smtp.host=smtp.gmail.com
mail.username=<gmail-user-account>
mail.password=<gmail-password>
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.quitwait=false
#mail.smtp.port=587
#mail.smtp.host=smtp.gmail.com
#mail.username=<gmail-user-account>
#mail.password=<gmail-password>
#mail.smtp.auth=true
#mail.smtp.starttls.enable=true
#mail.smtp.quitwait=false
#------------------------
# Emails configuration