java.lang.Object
com.aquima.interactions.foundation.connectivity.impl.MailMessage
All Implemented Interfaces:
IMailMessage
Direct Known Subclasses:
HtmlMailMessage, TextMailMessage

public abstract class MailMessage extends Object implements IMailMessage
This abstract class can be used for standard email messages, it does not (yet) support attachments.
Since:
6.4
Author:
Jon van Leuven
  • Constructor Details

    • MailMessage

      public MailMessage(IMailAddress sender, IMailAddress recipient, String subject, String body)
      Create a basic email message with a sender, one recipient, a subject and a body.
      Parameters:
      sender - The sender, may not be null
      recipient - The recipient, may not be null
      subject - The subject, may be null
      body - The body of the message, may be null
    • MailMessage

      public MailMessage(IMailAddress sender, IMailAddress[] recipients, IMailAddress[] carbonCopyRecipients, IMailAddress[] blindCarbonCopyRecipients, IMailMessageAttachment[] attachments, String subject, String body)
      Create a fully specified email message. Note: the message should contain at least one recipient (to/cc/bcc)
      Parameters:
      sender - The sender, may not be null
      recipients - The recipients, may be null
      carbonCopyRecipients - The cc recipients, may be null
      blindCarbonCopyRecipients - The bcc recipients, may be null
      attachments - The mail message attachments, may be null
      subject - The subject, may be null
      body - The body of the message, may be null
  • Method Details

    • getBcc

      public IMailAddress[] getBcc()
      Description copied from interface: IMailMessage
      This method returns the recipient addresses that receive a bcc (blind carbon copy) message.
      Specified by:
      getBcc in interface IMailMessage
      Returns:
      An array of email address, if no bcc specified it must return IMailAddress[0].
    • getBody

      public String getBody()
      Description copied from interface: IMailMessage
      This method returns the body of the message.
      Specified by:
      getBody in interface IMailMessage
      Returns:
      The body of the email message, may be null.
    • getCc

      public IMailAddress[] getCc()
      Description copied from interface: IMailMessage
      This method returns the recipient addresses that receive a cc (carbon copy) message.
      Specified by:
      getCc in interface IMailMessage
      Returns:
      An array of email address, if no cc specified it must return IMailAddress[0].
    • getFrom

      public IMailAddress getFrom()
      Description copied from interface: IMailMessage
      This method returns the sender's address.
      Specified by:
      getFrom in interface IMailMessage
      Returns:
      The email addres of the sender, may not be null.
    • getTo

      public IMailAddress[] getTo()
      Description copied from interface: IMailMessage
      This method returns the recipient addresses.
      Specified by:
      getTo in interface IMailMessage
      Returns:
      An array of email address, if no recipient specified it must return IMailAddress[0].
    • getAttachments

      public IMailMessageAttachment[] getAttachments()
      Description copied from interface: IMailMessage
      This method returns the mail attachments.
      Specified by:
      getAttachments in interface IMailMessage
      Returns:
      An array of mail attachments, never null, can be empty.
    • getSubject

      public String getSubject()
      Description copied from interface: IMailMessage
      This method returns the subject of the message.
      Specified by:
      getSubject in interface IMailMessage
      Returns:
      The subject of the email message, may be null.