Class Mailer

java.lang.Object
org.nuxeo.ecm.automation.core.mail.Mailer

@Deprecated(since="2023.4") public class Mailer extends Object
Deprecated.
since 2023.4 Use a MailSender instead
Author:
Bogdan Stefanescu
  • Field Details

    • config

      protected Properties config
      Deprecated.
    • session

      protected volatile javax.mail.Session session
      Deprecated.
    • auth

      @Deprecated(since="11.1") protected javax.mail.Authenticator auth
      Deprecated.
      since 11.1, not used anymore
    • sessionName

      protected final String sessionName
      Deprecated.
      The JNDI session name. If not null JNDI will be used to lookup the default session, otherwise local configuration (through config) will be used to create a session.
  • Constructor Details

    • Mailer

      @Deprecated(since="11.1") public Mailer()
      Deprecated.
      since 11.1, use other constructors instead
      Create a mailer that can be configured using the API.
      See Also:
    • Mailer

      public Mailer(Properties config)
      Deprecated.
      Create a mailer that use the given properties to configure the session.
    • Mailer

      public Mailer(String sessionName)
      Deprecated.
      Create a mailer using a session that lookup for the session in JNDI under the given session name.
    • Mailer

      public Mailer(String sessionName, Properties config)
      Deprecated.
      Create a mailer using a session that lookup for the session in JNDI under the given session name. If the JNDI binding doesn't exists use the given properties to cinfiugure the session.
  • Method Details

    • setServer

      public void setServer(String host)
      Deprecated.
    • setServer

      public void setServer(String host, boolean ssl)
      Deprecated.
    • setServer

      public void setServer(String host, String port)
      Deprecated.
      Set the SMTP server address to use
    • setServer

      public void setServer(String host, String port, boolean ssl)
      Deprecated.
    • setCredentials

      @Deprecated(since="11.1") public void setCredentials(String user, String pass)
      Deprecated.
      since 11.1, use mail.${protocol}.user and mail.${protocol}.password instead
      Set SMTP credentials.
    • setAuthenticator

      @Deprecated(since="11.1") public void setAuthenticator(javax.mail.Authenticator auth)
      Deprecated.
      since 11.1, this method does nothing, use mail.${protocol}.user and mail.${protocol}.password instead
    • setDebug

      public void setDebug(boolean debug)
      Deprecated.
    • getSession

      public javax.mail.Session getSession()
      Deprecated.
    • getConfiguration

      public Properties getConfiguration()
      Deprecated.
    • setConfiguration

      public void setConfiguration(Properties config)
      Deprecated.
    • loadConfiguration

      public void loadConfiguration(InputStream in) throws IOException
      Deprecated.
      Throws:
      IOException
    • send

      public void send(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
      Deprecated.
      Throws:
      javax.mail.MessagingException
    • newMessage

      public Mailer.Message newMessage()
      Deprecated.
    • sendEmail

      public void sendEmail(String from, String to, String subject, String body) throws javax.mail.MessagingException
      Deprecated.
      Send a single email.
      Throws:
      javax.mail.MessagingException