Class SmtpServer

java.lang.Object
overit.geocall.mail.MailServer
overit.geocall.mail.SmtpServer

public class SmtpServer extends MailServer
This class manages all the properties used to send an email such as ssl, port, dns, host, protocol etc.
  • Field Details

    • _protocol

      protected String _protocol
    • _tls

      protected boolean _tls
    • _ssl

      protected String _ssl
    • _port

      protected Integer _port
    • _host

      protected String _host
    • _sendPartial

      protected boolean _sendPartial
    • _timeout

      protected String _timeout
    • _dsn

      protected boolean _dsn
    • _debug

      protected boolean _debug
    • _delay

      protected int _delay
  • Constructor Details

    • SmtpServer

      public SmtpServer(String host)
      Creates a new SmtpServer
      Parameters:
      host - The host of the smtp server
    • SmtpServer

      public SmtpServer(String protocol, String host)
      Creates a new SmtpServer
      Parameters:
      protocol - The protocol used by the smtp server
      host - The host of the smtp server
  • Method Details

    • setPort

      public void setPort(int i)
      Sets the number of the port
      Parameters:
      i - The number of the port
    • getPort

      public int getPort()
      Returns the number of the port
      Returns:
      The number of the port
    • setProtocol

      public final void setProtocol(String protocol)
      Sets the protocol used by the smtp server
      Parameters:
      protocol - String containing the protocol used by the smtp server
    • getHost

      public String getHost()
      Returns the host
      Returns:
      The host
    • getProtocol

      public String getProtocol()
      Returns the procotol
      Returns:
      The protocol
    • getTls

      public boolean getTls()
      Returns the tls
      Returns:
      The tls
    • getSsl

      public String getSsl()
      Returns the ssl
      Returns:
      The ssl
    • getSendPartial

      public boolean getSendPartial()
      Returns if send partial capability is abilitated
      Returns:
      true if send partial capability is abilitated, false otherwise
    • getDsn

      public boolean getDsn()
      Returns if dns capability is abilitated
      Returns:
      true if dsn capability is abilitated, false otherwise
    • getTimeout

      public String getTimeout()
      Returns the timeout
      Returns:
      The timeout
    • setDebug

      public void setDebug(boolean debug)
      Sets if debug capability should be abilitated
      Parameters:
      debug - Boolean value indicating if debug capability should be abilitated
    • send

      public void send(Message m) throws EmailException
      Send the email through the smtp server
      Specified by:
      send in class MailServer
      Parameters:
      m - The Message to send
      Throws:
      EmailException - If an error occurs
    • systemSend

      public static void systemSend(Message m) throws EmailException
      Sends an email with the info in the configuration file
      Parameters:
      m - The message to send
      Throws:
      EmailException - If an error occurs
    • main

      public static void main(String[] ss) throws Exception
      Throws:
      Exception