Interface MailMessage
-
- All Known Subinterfaces:
AgentDraftMessage
,AgentMessage
,BacklogMessage
,DeliveryFailureMessage
,ExternalReplyMessage
,IncomingMessage
,OutgoingMessage
,PreSendAgentMessage
,PreSendMessage
,QuickCaseMessage
,SentMessage
,TemplateMessage
public interface MailMessage
Represents an object, that has a
javax.mail.Message
- Since:
- 10.0.16
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<MessageAttachmentDataSource>
getAttachments()
javax.mail.internet.InternetAddress
getFromAddress()
java.lang.String[]
getHeader(java.lang.String name)
java.lang.String
getHtml()
javax.mail.Message
getMessageCopy()
The method returns a copy of the underlyingMessage
.java.lang.String
getMessageId()
java.lang.String
getSubject()
java.lang.String
getText()
void
writeTo(java.io.OutputStream outputStream)
Output the underlying message as an RFC 822 format stream.
-
-
-
Method Detail
-
getMessageId
java.lang.String getMessageId()
- Returns:
- the message id as string
- Since:
- 10.0.16
-
getFromAddress
javax.mail.internet.InternetAddress getFromAddress()
- Returns:
- the sender address of the message
- Since:
- 10.0.42
-
getSubject
java.lang.String getSubject()
- Returns:
- the subject as string
- Since:
- 10.0.16
-
getText
java.lang.String getText()
- Returns:
- the plain text of the message as string
- Since:
- 10.0.16
-
getHtml
java.lang.String getHtml()
- Returns:
- the html text of the message as string
- Since:
- 10.0.16
-
getAttachments
java.util.Set<MessageAttachmentDataSource> getAttachments()
- Returns:
- a Set of all attachments of the message
- Since:
- 11.0
-
getHeader
java.lang.String[] getHeader(java.lang.String name)
- Parameters:
name
- the name of the header- Returns:
- array of decoded headers for the given name
- Since:
- 10.0.142
-
writeTo
void writeTo(java.io.OutputStream outputStream) throws java.io.IOException, javax.mail.MessagingException
Output the underlying message as an RFC 822 format stream. Example code to obtain a MimeMessage instance:try { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(16384); mailMessage.writeTo(out); javax.mail.internet.MimeMessage m = new javax.mail.internet.MimeMessage((javax.mail.Session)null, new java.io.ByteArrayInputStream(out.toByteArray())); // do something with the MimeMessage; } catch (java.io.IOException | javax.mail.MessagingException e) {}
- Parameters:
outputStream
- the OutputStream to write the message data- Throws:
java.io.IOException
- if an error occurs writing to the streamjavax.mail.MessagingException
- if an error occurs fetching the data to be written
-
getMessageCopy
javax.mail.Message getMessageCopy() throws java.io.IOException, javax.mail.MessagingException
The method returns a copy of the underlyingMessage
. Please note that frequent usage of this method may impact the heap memory consumption and general system performance.- Returns:
- a copy of the underlying
Message
- Throws:
java.io.IOException
- if an error occurs writing to the streamjavax.mail.MessagingException
- if an error occurs fetching the data to be written- Since:
- 12.33
-
-