Class Email

java.lang.Object
overit.geocall.mail.Email

public class Email extends Object
Class that manages the Email object with its relative attachments and properties
  • Field Details

    • _identity

      protected Identity _identity
    • _session

      protected Session _session
    • _message

      protected MimeMessage _message
    • _xml

      protected XMLTree _xml
    • _contentType

      protected String _contentType
    • _bodyCharset

      protected String _bodyCharset
    • _authenticator

      protected Authenticator _authenticator
    • _debug

      protected static boolean _debug
  • Constructor Details

  • Method Details

    • setContentType

      public void setContentType(String s)
      Sets the content type
      Parameters:
      s - String containing the content type to set
    • setAuthenticator

      public void setAuthenticator(Authenticator authenticator)
      Sets the authenticator
      Parameters:
      authenticator - The Authenticator to set
    • setSubject

      public void setSubject(String s)
      Sets the subject of the email
      Parameters:
      s - String containing the subject of the email
    • setPriority

      public void setPriority(int p)
      Sets the priority of the email
      Parameters:
      p - The priority
    • setFrom

      public void setFrom(String address, String name)
      Sets the "from" of the email
      Parameters:
      address - The address
      name - The name
    • addTo

      public void addTo(String address, String name)
      Sets the "to" of the email
      Parameters:
      address - The address
      name - The name
    • addCc

      public void addCc(String address, String name)
      Sets the "cc" of the email
      Parameters:
      address - The address
      name - The name
    • addBcc

      public void addBcc(String address, String name)
      Sets the "bcc" of the email
      Parameters:
      address - The address
      name - The name
    • removeAddress

      protected void removeAddress(String type, String address, String name)
    • removeTo

      public void removeTo(String address, String name)
      Remove the "to" of the email
      Parameters:
      address - The address
      name - The name
    • removeCc

      public void removeCc(String address, String name)
      Remove the "cc" of the email
      Parameters:
      address - The address
      name - The name
    • removeBcc

      public void removeBcc(String address, String name)
      Remove the "bcc" of the email
      Parameters:
      address - The address
      name - The name
    • setBody

      public void setBody(String text)
      Sets the body of the email
      Parameters:
      text - The text
    • addAttachment

      public void addAttachment(String resource)
      Add a new attachment to the email
      Parameters:
      resource - String containing the resource to add
    • removeAttachment

      public void removeAttachment(String res)
      Revome an attachment to the email
      Parameters:
      res - String containing the resource to remove
    • getAttachments

      public DBView getAttachments()
      Returns the DBView of the attachments
      Returns:
      The DBView of the attachments
    • getAddresses

      protected DBView getAddresses(String type)
    • getTos

      public DBView getTos()
      Returns the DBView of the "to"s of the email
      Returns:
      The DBView of the "to"s of the email
    • getCcs

      public DBView getCcs()
      Returns the DBView of the "cc"s of the email
      Returns:
      The DBView of the "cc"s of the email
    • getBccs

      public DBView getBccs()
      Returns the DBView of the "bcc"s of the email
      Returns:
      The DBView of the "bcc"s of the email
    • getFrom

      public Getter getFrom()
      Returns the Getter with the from
      Returns:
      The Getter with the from
    • getSubject

      public String getSubject()
      Returns the subject of the email
      Returns:
      The subject of the email
    • getPriority

      public int getPriority()
      Returns the priority of the email
      Returns:
      The priority of the email
    • getBody

      public String getBody()
      Returns the string containing the body of the email
      Returns:
      The string containing the body of the email
    • getXML

      public XMLTree getXML()
      Returns the XMLTree
      Returns:
      The XMLTree
    • send

      public void send() throws EmailException
      Send the email
      Throws:
      EmailException - if an error occurs sending the email
    • send

      public void send(SmtpServer ss) throws EmailException
      Send the email
      Parameters:
      ss - The SmtpServer
      Throws:
      EmailException - if an error occurs sending the email
    • writeTo

      public void writeTo(String s) throws IOException, EmailException
      Write the email in a file
      Parameters:
      s - The name of the file
      Throws:
      IOException - if an I/O exception occurs
      EmailException - if an error occurs sending the email
    • getError

      public String getError()
      Returns a string containing the name of the resources that cannot be attached
      Returns:
      A string containing the name of the resources that cannot be attached
    • _construct

      protected void _construct() throws MessagingException
      Throws:
      MessagingException