diff --git a/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/BackgroundTasks.java b/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/BackgroundTasks.java index 52e902e..2cb5e2e 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/BackgroundTasks.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/BackgroundTasks.java @@ -9,16 +9,10 @@ import java.io.IOException; import java.util.TimerTask; public class BackgroundTasks extends TimerTask { - private final TaskList taskList; - private final Garden garden; - private final PlantList plantList; private final Notifier notifier; //TODO uncomment: privat final WeatherGardenTaskPlaner weatherGardenTaskPlaner; public BackgroundTasks(TaskList taskList, Garden garden, PlantList plantList) { - this.taskList = taskList; - this.garden = garden; - this.plantList = plantList; notifier = new Notifier(taskList, garden, plantList); //TODO uncomment: weatherGardenTaskPlaner = new WeatherGardenTaskPlaner(taskList); } diff --git a/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/email/EMailSender.java b/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/email/EMailSender.java index 734967c..82f895a 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/email/EMailSender.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/backgroundtasks/email/EMailSender.java @@ -2,10 +2,7 @@ package ch.zhaw.gartenverwaltung.backgroundtasks.email; import ch.zhaw.gartenverwaltung.Settings; -import javax.mail.Address; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Transport; +import javax.mail.*; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.ArrayList; @@ -33,8 +30,12 @@ public class EMailSender { message.setText(text); message.setSentDate(new Date()); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients, false)); - System.out.println("Message is ready: "); - Transport.send(message); + try{ + Transport.send(message); + } catch (MessagingException e) { + e.printStackTrace(); + // TODO logger + } } private void printMail(String receiver, String subject, String text){