Class SendMailHelper

java.lang.Object
de.elo.mover.main.helper.SendMailHelper

public class SendMailHelper extends Object

Überschrift: SendMailHelper.

Beschreibung: Hilfsklasse für das Versenden von E-Mails.

Copyright: Copyright (c) ELO Digital Office GmbH 2018 - 2020

  • 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 session
      files - Liste mit Dateien
      fromAddress - E-Mail Sender
      toAddress - E-Mail Empfänger
      ccAddress - Weitere E-Mail Empfänger
      bccAddress - Versteckte weitere E-Mail Empfänger
      subject - E-Mail Betreff
      body - E-Mail Inhalt oder null
      Throws:
      jakarta.mail.MessagingException
      IOException
      Exception
    • 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 - Hostname
      smtpUser - SMTP-Benutzer
      smtpPassword - SMTP-Passwort
      useSsl - SSL-Verschlüsselung verwenden
      debug - Debug-Ausgaben aktivieren
      Returns:
      E-Mail Session
      Throws:
      UnknownHostException
      Exception
    • 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 - Hostname
      smtpUser - SMTP Benutzer
      smtpPassword - SMTP-Passwort
      portNr - Port Nummer
      debug - 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-Verbindung
      session - E-Mail Session
      objIds - Liste mit Objekt-IDs
      ecdProperties - Original oder ECD-Datei versenden
      fromAddress - E-Mail Absender
      toAddress - E-Mail Empfänger
      ccAddress - Weitere E-Mail Empfänger
      bccAddress - Versteckte weitere E-Mail Empfänger
      subject - E-Mail Betreff
      body - E-Mail Inhalt
      Throws:
      jakarta.mail.MessagingException
      Exception
    • 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-Verbindung
      session - E-Mail Session
      sords - Liste mit Einträgen
      ecdProperties - Original oder ECD-Datei versenden
      fromAddress - E-Mail Absender
      toAddress - E-Mail Empfänger
      ccAddress - Weitere E-Mail Empfänger
      bccAddress - Versteckte weitere E-Mail Empfänger
      subject - E-Mail Betreff
      body - E-Mail Inhalt
      Throws:
      jakarta.mail.MessagingException
      Exception
    • 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 Session
      fromAddress - E-Mail Sender
      toAddress - E-Mail Empfänger
      ccAddress - Weitere E-Mail Empfänger
      bccAddress - Versteckte weitere E-Mail Empfänger
      subject - E-Mail Betreff
      body - E-Mail Body
      Throws:
      Exception
    • isValidAddress

      public static boolean isValidAddress(String emailAddress) throws Exception
      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