Package de.elo.mover.main.helper
Class SendMailHelper
java.lang.Object
de.elo.mover.main.helper.SendMailHelper
Überschrift: SendMailHelper.
Beschreibung: Hilfsklasse für das Versenden von E-Mails.
Copyright: Copyright (c) ELO Digital Office GmbH 2018 - 2020
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.mail.SessioncreateSendSession(String host, String smtpUser, String smtpPassword, boolean useSsl, boolean debug) Erzeugt eine E-Mail Session mit den angegebenen Daten.static jakarta.mail.SessioncreateSslSendSession(String host, String smtpUser, String smtpPassword, int portNr, boolean debug) Erzeugt eine SSL E-Mail Session mit den angegebenen Daten.static booleanisValidAddress(String emailAddress) Meldet zurück, ob die angegebene E-Mail Adresse eine gültige Syntax hat.static voidsendMail(jakarta.mail.Session session, File[] files, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) Versendet die Dateien an die angegebene E-Mail Adresse.static voidsendMail2(IXconnect ixConnect, jakarta.mail.Session session, int[] objIds, boolean[] ecdProperties, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) Versendet die angegebenen Dokumente als Original oder als ELO-Link.static voidsendMail3(IXconnect ixConnect, jakarta.mail.Session session, de.elo.ix.client.Sord[] sords, boolean[] ecdProperties, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) Versendet die angegebenen Dokumente als Original oder als ELO-Link.static voidsendSimpleMail(jakarta.mail.Session session, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) Versendet eine E-Mail ohne Anhang an der angegebenen E-Mail Adresse.
-
Constructor Details
-
SendMailHelper
public SendMailHelper()
-
-
Method Details
-
sendMail
public static void sendMail(jakarta.mail.Session session, File[] files, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) throws jakarta.mail.MessagingException, IOException, Exception Versendet die Dateien an die angegebene E-Mail Adresse.- Parameters:
session- E-Mail sessionfiles- Liste mit DateienfromAddress- E-Mail SendertoAddress- E-Mail EmpfängerccAddress- Weitere E-Mail EmpfängerbccAddress- Versteckte weitere E-Mail Empfängersubject- E-Mail Betreffbody- E-Mail Inhalt oder null- Throws:
jakarta.mail.MessagingExceptionIOExceptionException
-
createSendSession
public static jakarta.mail.Session createSendSession(String host, String smtpUser, String smtpPassword, boolean useSsl, boolean debug) throws UnknownHostException, Exception Erzeugt eine E-Mail Session mit den angegebenen Daten.- Parameters:
host- HostnamesmtpUser- SMTP-BenutzersmtpPassword- SMTP-PasswortuseSsl- SSL-Verschlüsselung verwendendebug- Debug-Ausgaben aktivieren- Returns:
- E-Mail Session
- Throws:
UnknownHostExceptionException
-
createSslSendSession
public static jakarta.mail.Session createSslSendSession(String host, String smtpUser, String smtpPassword, int portNr, boolean debug) throws Exception Erzeugt eine SSL E-Mail Session mit den angegebenen Daten.- Parameters:
host- HostnamesmtpUser- SMTP BenutzersmtpPassword- SMTP-PasswortportNr- Port Nummerdebug- Debug-Ausgaben aktivieren- Returns:
- Debug Session
- Throws:
Exception
-
sendMail2
public static void sendMail2(IXconnect ixConnect, jakarta.mail.Session session, int[] objIds, boolean[] ecdProperties, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) throws jakarta.mail.MessagingException, Exception Versendet die angegebenen Dokumente als Original oder als ELO-Link.- Parameters:
ixConnect- Indexserver-Verbindungsession- E-Mail SessionobjIds- Liste mit Objekt-IDsecdProperties- Original oder ECD-Datei versendenfromAddress- E-Mail AbsendertoAddress- E-Mail EmpfängerccAddress- Weitere E-Mail EmpfängerbccAddress- Versteckte weitere E-Mail Empfängersubject- E-Mail Betreffbody- E-Mail Inhalt- Throws:
jakarta.mail.MessagingExceptionException
-
sendMail3
public static void sendMail3(IXconnect ixConnect, jakarta.mail.Session session, de.elo.ix.client.Sord[] sords, boolean[] ecdProperties, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) throws jakarta.mail.MessagingException, Exception Versendet die angegebenen Dokumente als Original oder als ELO-Link.- Parameters:
ixConnect- Indexserver-Verbindungsession- E-Mail Sessionsords- Liste mit EinträgenecdProperties- Original oder ECD-Datei versendenfromAddress- E-Mail AbsendertoAddress- E-Mail EmpfängerccAddress- Weitere E-Mail EmpfängerbccAddress- Versteckte weitere E-Mail Empfängersubject- E-Mail Betreffbody- E-Mail Inhalt- Throws:
jakarta.mail.MessagingExceptionException
-
sendSimpleMail
public static void sendSimpleMail(jakarta.mail.Session session, String fromAddress, String toAddress, String ccAddress, String bccAddress, String subject, String body) throws Exception Versendet eine E-Mail ohne Anhang an der angegebenen E-Mail Adresse.- Parameters:
session- E-Mail SessionfromAddress- E-Mail SendertoAddress- E-Mail EmpfängerccAddress- Weitere E-Mail EmpfängerbccAddress- Versteckte weitere E-Mail Empfängersubject- E-Mail Betreffbody- E-Mail Body- Throws:
Exception
-
isValidAddress
Meldet zurück, ob die angegebene E-Mail Adresse eine gültige Syntax hat.- Parameters:
emailAddress- E-Mail Adresse- Returns:
- E-Mail Adresse ist gültig
- Throws:
Exception
-