]> git.mxchange.org Git - jmailer-ee.git/blobdiff - src/org/mxchange/jmailee/model/delivery/BaseMailer.java
updated own name and resources
[jmailer-ee.git] / src / org / mxchange / jmailee / model / delivery / BaseMailer.java
index 64cbf368f298aab785901333d7941146cb3af1e8..8c75fbea147d7afb3abfbe058fdba21c8e21ee05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
 /**
  * An email class for sending out mails from templates
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 public abstract class BaseMailer implements DeliverableEmail {
 
@@ -59,10 +59,10 @@ public abstract class BaseMailer implements DeliverableEmail {
        /**
         * Properties for this mailer
         * <p>
-        * Valid are:
-        * - mailer.errorsto = Email address for "Errors-To" header
-        * - mailer.bouncesto = Email address for "Bounces-To" header (optional, if not set, errorsto must be set)
-        * - mailer.xloop = Email address for "X-Loop" header (optional, if not set, errorsto must be set)
+        * Valid are: - mailer.errorsto = Email address for "Errors-To" header -
+        * mailer.bouncesto = Email address for "Bounces-To" header (optional, if
+        * not set, errorsto must be set) - mailer.xloop = Email address for
+        * "X-Loop" header (optional, if not set, errorsto must be set)
         */
        private Properties properties;
 
@@ -154,24 +154,23 @@ public abstract class BaseMailer implements DeliverableEmail {
                message.setHeader("MIME-Version", "1.0"); //NOI18N
                message.setHeader("Content-Type", "text/plain; charset=UTF-8"); //NOI18N
                message.setHeader("Content-Transfer-Encoding", "8bit"); //NOI18N
-               message.setHeader("Errors-To", this.properties.getProperty("mailer.errorsto")); //NOI18N
+
+               // Is property "errorsto" set ?
+               if ((this.properties.containsKey("mailer.errorsto")) && (!this.properties.getProperty("mailer.errorsto").isEmpty())) { //NOI18N
+                       // Use this
+                       message.setHeader("Errors-To", this.properties.getProperty("mailer.errorsto")); //NOI18N#
+               }
 
                // Is the property "bouncesto" set?
-               if (this.properties.containsKey("mailer.bouncesto")) { //NOI18N
+               if ((this.properties.containsKey("mailer.bouncesto")) && (!this.properties.getProperty("mailer.bouncesto").isEmpty())) { //NOI18N
                        // Use this
                        message.setHeader("Bounces-To", this.properties.getProperty("mailer.bouncesto")); //NOI18N
-               } else {
-                       // Use "errorsto"
-                       message.setHeader("Bounces-To", this.properties.getProperty("mailer.errorsto")); //NOI18N
                }
 
                // Is the property "xloop" set?
-               if (this.properties.containsKey("mailer.xloop")) { //NOI18N
+               if ((this.properties.containsKey("mailer.xloop")) && (!this.properties.getProperty("mailer.xloop").isEmpty())) { //NOI18N
                        // Use this
                        message.setHeader("X-Loop", this.properties.getProperty("mailer.xloop")); //NOI18N
-               } else {
-                       // Use "errorsto"
-                       message.setHeader("X-Loop", this.properties.getProperty("mailer.errorsto")); //NOI18N
                }
 
                // Directly send email