|
|
|
@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
|
|
|
|
|
package de.srsoftware.widerhall.mail; |
|
|
|
|
|
|
|
|
|
import com.sun.mail.imap.protocol.ENVELOPE; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
@ -16,19 +17,21 @@ public class SmtpClient {
@@ -16,19 +17,21 @@ public class SmtpClient {
|
|
|
|
|
private static final String HOST = "mail.smtp.host"; |
|
|
|
|
private static final String PORT = "mail.smtp.port"; |
|
|
|
|
private static final String AUTH = "mail.smtp.auth"; |
|
|
|
|
private static final String ENVELOPE_FROM = "mail.smtp.from"; |
|
|
|
|
private static final String SSL = "mail.smtp.ssl.enable"; |
|
|
|
|
private static final String UTF8 = "UTF-8"; |
|
|
|
|
private final String host,password,username; |
|
|
|
|
private final String host,password,username,from; |
|
|
|
|
private final int port; |
|
|
|
|
private boolean forwardUsingListAddress = true; |
|
|
|
|
|
|
|
|
|
private Session session; |
|
|
|
|
|
|
|
|
|
public SmtpClient(String host, int port, String username, String password){ |
|
|
|
|
public SmtpClient(String host, int port, String username, String password, String envelopeFrom){ |
|
|
|
|
this.username = username; |
|
|
|
|
this.password = password; |
|
|
|
|
this.host = host; |
|
|
|
|
this.port = port; |
|
|
|
|
this.from = envelopeFrom; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -87,6 +90,7 @@ public class SmtpClient {
@@ -87,6 +90,7 @@ public class SmtpClient {
|
|
|
|
|
props.put(PORT, port); |
|
|
|
|
props.put(AUTH, true); |
|
|
|
|
props.put(SSL, true); |
|
|
|
|
props.put(ENVELOPE_FROM,from); |
|
|
|
|
|
|
|
|
|
session = Session.getInstance(props); |
|
|
|
|
LOG.debug("Neue Session erzeugt: {}", session); |
|
|
|
|