Class EmailMessage


  • public final class EmailMessage
    extends java.lang.Object
    Holds information retrieved from the mock SMTP server deployed in Sling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String HEADER_FROM  
      static java.lang.String HEADER_SUBJECT  
      static java.lang.String HEADER_TO  
    • Constructor Summary

      Constructors 
      Constructor Description
      EmailMessage​(java.lang.String content)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String key, java.lang.String value)
      Adds a new header to this email message
      java.lang.String getContent()
      Returns the contents of the email
      java.lang.String getHeader​(java.lang.String key)
      Returns the value of one of the headers of this email
      java.util.Map<java.lang.String,​java.lang.String> getHeaders()
      Returns an unmodifiable view over the email headers
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EmailMessage

        public EmailMessage​(java.lang.String content)
    • Method Detail

      • addHeader

        public void addHeader​(java.lang.String key,
                              java.lang.String value)
        Adds a new header to this email message
        Parameters:
        key - the header name
        value - the header value
      • getHeader

        public java.lang.String getHeader​(java.lang.String key)
        Returns the value of one of the headers of this email
        Parameters:
        key - the header name
        Returns:
        the value of the header, possibly null
      • getHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        Returns an unmodifiable view over the email headers
        Returns:
        the headers
      • getContent

        public java.lang.String getContent()
        Returns the contents of the email
        Returns:
        the email content