Uses of Class
jakarta.mail.MessagingException
Package
Description
The Jakarta Mail API
provides classes that model a mail system.
Classes specific to Internet mail systems.
Message search terms for the Jakarta Mail API.
Support for creating and parsing Delivery Status Notifications.
An EXPERIMENTAL IMAP protocol provider that supports the
Gmail-specific IMAP protocol extensions
.
An IMAP protocol provider for the Jakarta Mail API
that provides access to an IMAP message store.
A POP3 protocol provider for the Jakarta Mail API
that provides access to a POP3 message store.
An SMTP protocol provider for the Jakarta Mail API
that provides access to an SMTP server.
Utility classes for use with the Jakarta Mail API.
-
Uses of MessagingException in jakarta.mail
Modifier and TypeClassDescriptionclass
This exception is thrown when the connect method on a Store or Transport object fails due to an authentication failure (e.g., bad user name or password).class
This exception is thrown when a method is invoked on a Messaging object and the Folder that owns that object has died due to some reason.class
This exception is thrown by Folder methods, when those methods are invoked on a non existent folder.class
The exception thrown when a write is attempted on a read-only attribute of any Messaging object.class
The exception thrown when an invalid method is invoked on an expunged Message.class
The exception thrown when a method is not supported by the implementationclass
This exception is thrown when Session attempts to instantiate a Provider that doesn't exist.class
This exception is thrown when an attempt is made to open a folder read-write access when the folder is marked read-only.class
This exception is thrown when the message cannot be sent.class
This exception is thrown when a method is invoked on a Messaging object and the Store that owns that object has died due to some reason.Modifier and TypeMethodDescriptionvoid
Multipart.addBodyPart
(BodyPart part) Adds a Part to the multipart.void
Multipart.addBodyPart
(BodyPart part, int index) Adds a BodyPart at positionindex
.abstract void
Add these addresses to the existing "From" attributevoid
Add this value to the existing values for this header_name.void
Message.addRecipient
(Message.RecipientType type, Address address) Add this recipient address to the existing ones of the given type.abstract void
Message.addRecipients
(Message.RecipientType type, Address[] addresses) Add these recipient addresses to the existing ones of the given type.abstract void
Folder.appendMessages
(Message[] msgs) Append given Messages to this folder.void
Folder.close()
Close this Folder and expunge deleted messages.abstract void
Folder.close
(boolean expunge) Close this Folder.void
Service.close()
Close this service and terminate its connection.void
Service.connect()
A generic connect method that takes no parameters.void
Similar to connect(host, user, password) except a specific port can be specified.void
Connect to the current host using the specified username and password.void
Connect to the specified address.void
Folder.copyMessages
(Message[] msgs, Folder folder) Copy the specified Messages from this Folder into another Folder.abstract boolean
Folder.create
(int type) Create this folder on the Store.abstract boolean
Folder.delete
(boolean recurse) Delete this Folder.abstract boolean
Folder.exists()
Tests if this folder physically exists on the Store.abstract Message[]
Folder.expunge()
Expunge (permanently remove) messages marked DELETED.void
Folder.fetch
(Message[] msgs, FetchProfile fp) Prefetch the items specified in the FetchProfile for the given Messages.Part.getAllHeaders()
Return all the headers from this part as an Enumeration of Header objects.Address[]
Message.getAllRecipients()
Get all the recipient addresses for the message.Multipart.getBodyPart
(int index) Get the specified Part.MultipartDataSource.getBodyPart
(int index) Get the specified Part.Part.getContent()
Return the content as a Java object.Part.getContentType()
Returns the Content-Type of the content of this part.int
Multipart.getCount()
Return the number of enclosed BodyPart objects.jakarta.activation.DataHandler
Part.getDataHandler()
Return a DataHandler for the content within this part.abstract Folder
Store.getDefaultFolder()
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.int
Folder.getDeletedMessageCount()
Get the number of deleted messages in this Folder.Part.getDescription()
Return a description String for this part.Part.getDisposition()
Return the disposition of this part.Part.getFileName()
Get the filename associated with this part, if possible.abstract Flags
Message.getFlags()
Returns aFlags
object containing the flags for this message.abstract Folder
Return the Folder object corresponding to the given name.Get a closed Folder object for the given URLName.abstract Folder
Return a closed Folder object, corresponding to the given URLName.abstract Folder
Return the Folder object corresponding to the given name.abstract Address[]
Message.getFrom()
Returns the "From" attribute.String[]
Get all the headers for this header name.Part.getInputStream()
Return an input stream for this part's "content".int
Part.getLineCount()
Return the number of lines in the content of this part.Part.getMatchingHeaders
(String[] header_names) Return matching headers from this part as an Enumeration of Header objects.abstract Message
Folder.getMessage
(int msgnum) Get the Message object corresponding to the given message number.UIDFolder.getMessageByUID
(long uid) Get the Message corresponding to the given UID.abstract int
Folder.getMessageCount()
Get total number of messages in this Folder.Message[]
Folder.getMessages()
Get all Message objects from this Folder.Message[]
Folder.getMessages
(int[] msgnums) Get the Message objects for message numbers specified in the array.Message[]
Folder.getMessages
(int start, int end) Get the Message objects for message numbers ranging from start through end, both start and end inclusive.Message[]
UIDFolder.getMessagesByUID
(long[] uids) Get the Messages specified by the given array of UIDs.Message[]
UIDFolder.getMessagesByUID
(long start, long end) Get the Messages specified by the given range.int
Folder.getNewMessageCount()
Get the number of new messages in this Folder.Part.getNonMatchingHeaders
(String[] header_names) Return non-matching headers from this envelope as an Enumeration of Header objects.abstract Folder
Folder.getParent()
Returns the parent folder of this folder.Folder[]
Store.getPersonalNamespaces()
Return a set of folders representing the personal namespaces for the current user.Quota[]
Get the quotas for the named folder.abstract Date
Message.getReceivedDate()
Get the date this message was received.abstract Address[]
Message.getRecipients
(Message.RecipientType type) Get all the recipient addresses of the given type.Address[]
Message.getReplyTo()
Get the addresses to which replies should be directed.abstract Date
Message.getSentDate()
Get the date this message was sent.abstract char
Folder.getSeparator()
Return the delimiter character that separates this Folder's pathname from the names of immediate subfolders.Folder[]
Store.getSharedNamespaces()
Return a set of folders representing the shared namespaces.int
Part.getSize()
Return the size of the content of this part in bytes.abstract String
Message.getSubject()
Get the subject of this message.abstract int
Folder.getType()
Returns the type of this Folder, that is, whether this folder can hold messages or subfolders or both.long
Get the UID for the specified message.long
UIDFolder.getUIDNext()
Returns the predicted UID that will be assigned to the next message that is appended to this folder.long
UIDFolder.getUIDValidity()
Returns the UIDValidity value associated with this folder.int
Folder.getUnreadMessageCount()
Get the total number of unread messages in this Folder.Folder.getURLName()
Return a URLName representing this folder.Folder[]
Store.getUserNamespaces
(String user) Return a set of folders representing the namespaces foruser
.abstract boolean
Folder.hasNewMessages()
Returns true if this Folder has new messages since the last time this indication was reset.boolean
Part.isMimeType
(String mimeType) Is this Part of the specified MIME type? This method compares only theprimaryType
andsubType
.boolean
Message.isSet
(Flags.Flag flag) Check whether the flag specified in theflag
argument is set in this message.Folder[]
Folder.list()
Convenience method that returns the list of folders under this Folder.abstract Folder[]
Returns a list of Folders belonging to this Folder's namespace that match the specified pattern.Folder[]
Folder.listSubscribed()
Convenience method that returns the list of subscribed folders under this Folder.Folder[]
Folder.listSubscribed
(String pattern) Returns a list of subscribed Folders belonging to this Folder's namespace that match the specified pattern.boolean
Message.match
(SearchTerm term) Apply the specified Search criterion to this message.abstract void
Folder.open
(int mode) Open this Folder.protected boolean
Service.protocolConnect
(String host, int port, String user, String password) The service implementation should override this method to perform the actual protocol-specific connection attempt.void
Multipart.removeBodyPart
(int index) Remove the part at specified location (starting from 0).boolean
Multipart.removeBodyPart
(BodyPart part) Remove the specified part from the multipart message.void
Part.removeHeader
(String header_name) Remove all headers with this name.abstract boolean
Rename this Folder.abstract Message
Message.reply
(boolean replyToAll) Get a new Message suitable for a reply to this message.abstract void
Message.saveChanges()
Save any changes made to this message into the message-store when the containing folder is closed, if the message is contained in a folder.Message[]
Folder.search
(SearchTerm term) Search this Folder for messages matching the specified search criterion.Message[]
Folder.search
(SearchTerm term, Message[] msgs) Search the given array of messages for those that match the specified search criterion.static void
Send a message.static void
Send the message to the specified addresses, ignoring any recipients specified in the message itself.static void
Send the message to the specified addresses, ignoring any recipients specified in the message itself.static void
Send a message.abstract void
Transport.sendMessage
(Message msg, Address[] addresses) Send the Message to the specified list of addresses.void
Part.setContent
(Multipart mp) This method sets the given Multipart object as this message's content.void
Part.setContent
(Object obj, String type) A convenience method for setting this part's content.void
Part.setDataHandler
(jakarta.activation.DataHandler dh) This method provides the mechanism to set this part's content.void
Part.setDescription
(String description) Set a description String for this part.void
Part.setDisposition
(String disposition) Set the disposition of this part.void
Part.setFileName
(String filename) Set the filename associated with this part, if possible.void
Message.setFlag
(Flags.Flag flag, boolean set) Set the specified flag on this message to the specified value.void
Set the specified flags on the messages whose message numbers are in the array.void
Set the specified flags on the messages numbered from start through end, both start and end inclusive.void
Set the specified flags on the messages specified in the array.abstract void
Set the specified flags on this message to the specified value.abstract void
Message.setFrom()
Set the "From" attribute in this Message.abstract void
Set the "From" attribute in this Message.void
Set the value for this header_name.protected void
Multipart.setMultipartDataSource
(MultipartDataSource mp) Setup this Multipart object from the given MultipartDataSource.void
Set the quotas for the quota root specified in the quota argument.void
Message.setRecipient
(Message.RecipientType type, Address address) Set the recipient address.abstract void
Message.setRecipients
(Message.RecipientType type, Address[] addresses) Set the recipient addresses.void
Message.setReplyTo
(Address[] addresses) Set the addresses to which replies should be directed.abstract void
Message.setSentDate
(Date date) Set the sent date of this message.abstract void
Message.setSubject
(String subject) Set the subject of this message.void
Folder.setSubscribed
(boolean subscribe) Subscribe or unsubscribe this Folder.void
A convenience method that sets the given String as this part's content with a MIME type of "text/plain".abstract void
Multipart.writeTo
(OutputStream os) Output an appropriately encoded bytestream to the given OutputStream.void
Part.writeTo
(OutputStream os) Output a bytestream for this Part. -
Uses of MessagingException in jakarta.mail.internet
Modifier and TypeClassDescriptionclass
The exception thrown when a wrongly formatted address is encountered.class
The exception thrown due to an error in parsing RFC822 or MIME headers, including multipart bodies.Modifier and TypeMethodDescriptionvoid
MimeMultipart.addBodyPart
(BodyPart part) Adds a Part to the multipart.void
MimeMultipart.addBodyPart
(BodyPart part, int index) Adds a BodyPart at positionindex
.void
Add the specified addresses to the existing "From" field.void
Add this value to the existing values for this header_name.void
Add this value to the existing values for this header_name.void
MimeBodyPart.addHeaderLine
(String line) Add a header line to this body partvoid
MimeMessage.addHeaderLine
(String line) Add a raw RFC 822 header-line.void
MimePart.addHeaderLine
(String line) Add a raw RFC822 header-line.void
MimeMessage.addRecipients
(Message.RecipientType type, Address[] addresses) Add the given addresses to the specified recipient type.void
MimeMessage.addRecipients
(Message.RecipientType type, String addresses) Add the given addresses to the specified recipient type.void
MimeBodyPart.attachFile
(File file) Use the specified file to provide the data for this part.void
MimeBodyPart.attachFile
(File file, String contentType, String encoding) Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part.void
MimeBodyPart.attachFile
(String file) Use the specified file to provide the data for this part.void
MimeBodyPart.attachFile
(String file, String contentType, String encoding) Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part.protected InternetHeaders
MimeMessage.createInternetHeaders
(InputStream is) Create and return an InternetHeaders object that loads the headers from the given InputStream.protected InternetHeaders
MimeMultipart.createInternetHeaders
(InputStream is) Create and return an InternetHeaders object that loads the headers from the given InputStream.protected MimeBodyPart
MimeMultipart.createMimeBodyPart
(InternetHeaders headers, byte[] content) Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.protected MimeBodyPart
MimeMultipart.createMimeBodyPart
(InputStream is) Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.protected MimeMessage
MimeMessage.createMimeMessage
(Session session) Create and return a MimeMessage object.static InputStream
MimeUtility.decode
(InputStream is, String encoding) Decode the given input stream.static OutputStream
MimeUtility.encode
(OutputStream os, String encoding) Wrap an encoder around the given output stream.static OutputStream
MimeUtility.encode
(OutputStream os, String encoding, String filename) Wrap an encoder around the given output stream.MimeBodyPart.getAllHeaderLines()
Get all header lines as an Enumeration of Strings.MimeMessage.getAllHeaderLines()
Get all header lines as an Enumeration of Strings.MimePart.getAllHeaderLines()
Get all header lines as an Enumeration of Strings.MimeBodyPart.getAllHeaders()
Return all the headers from this Message as an Enumeration of Header objects.MimeMessage.getAllHeaders()
Return all the headers from this Message as an enumeration of Header objects.Address[]
MimeMessage.getAllRecipients()
Get all the recipient addresses for the message.MimeMultipart.getBodyPart
(int index) Get the specified BodyPart.MimeMultipart.getBodyPart
(String CID) Get the MimeBodyPart referred to by the given ContentID (CID).MimeBodyPart.getContent()
Return the content as a Java object.MimeMessage.getContent()
Return the content as a Java object.MimeBodyPart.getContentID()
Returns the value of the "Content-ID" header field.MimeMessage.getContentID()
Returns the value of the "Content-ID" header field.MimePart.getContentID()
Get the Content-ID of this part.String[]
MimeBodyPart.getContentLanguage()
Get the languages specified in the Content-Language header of this MimePart.String[]
MimeMessage.getContentLanguage()
Get the languages specified in the "Content-Language" header field of this message.String[]
MimePart.getContentLanguage()
Get the language tags specified in the Content-Language header of this MimePart.MimeBodyPart.getContentMD5()
Return the value of the "Content-MD5" header field.MimeMessage.getContentMD5()
Return the value of the "Content-MD5" header field.MimePart.getContentMD5()
Get the Content-MD5 digest of this part.protected InputStream
MimeBodyPart.getContentStream()
Produce the raw bytes of the content.protected InputStream
MimeMessage.getContentStream()
Produce the raw bytes of the content.MimeBodyPart.getContentType()
Returns the value of the RFC 822 "Content-Type" header field.MimeMessage.getContentType()
Returns the value of the RFC 822 "Content-Type" header field.int
MimeMultipart.getCount()
Return the number of enclosed BodyPart objects.jakarta.activation.DataHandler
MimeBodyPart.getDataHandler()
Return a DataHandler for this body part's content.jakarta.activation.DataHandler
MimeMessage.getDataHandler()
Return a DataHandler for this Message's content.MimeBodyPart.getDescription()
Returns the "Content-Description" header field of this body part.MimeMessage.getDescription()
Returns the "Content-Description" header field of this Message.MimeBodyPart.getDisposition()
Returns the disposition from the "Content-Disposition" header field.MimeMessage.getDisposition()
Returns the disposition from the "Content-Disposition" header field.MimeBodyPart.getEncoding()
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.MimeMessage.getEncoding()
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.MimePart.getEncoding()
Get the transfer encoding of this part.PreencodedMimeBodyPart.getEncoding()
Returns the content transfer encoding specified when this object was created.MimeBodyPart.getFileName()
Get the filename associated with this body part.MimeMessage.getFileName()
Get the filename associated with this Message.MimeMessage.getFlags()
Return aFlags
object containing the flags for this message.Address[]
MimeMessage.getFrom()
Returns the value of the RFC 822 "From" header fields.String[]
Get all the headers for this header_name.Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.String[]
Get all the headers for this header_name.Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter.MimeBodyPart.getInputStream()
Return a decoded input stream for this body part's "content".MimeMessage.getInputStream()
Return a decoded input stream for this Message's "content".int
MimeBodyPart.getLineCount()
Return the number of lines for the content of this Part.int
MimeMessage.getLineCount()
Return the number of lines for the content of this message.MimeBodyPart.getMatchingHeaderLines
(String[] names) Get matching header lines as an Enumeration of Strings.MimeMessage.getMatchingHeaderLines
(String[] names) Get matching header lines as an Enumeration of Strings.MimePart.getMatchingHeaderLines
(String[] names) Get matching header lines as an Enumeration of Strings.MimeBodyPart.getMatchingHeaders
(String[] names) Return matching headers from this Message as an Enumeration of Header objects.MimeMessage.getMatchingHeaders
(String[] names) Return matching headers from this Message as an Enumeration of Header objects.MimeMessage.getMessageID()
Returns the value of the "Message-ID" header field.MimeBodyPart.getNonMatchingHeaderLines
(String[] names) Get non-matching header lines as an Enumeration of Strings.MimeMessage.getNonMatchingHeaderLines
(String[] names) Get non-matching header lines as an Enumeration of Strings.MimePart.getNonMatchingHeaderLines
(String[] names) Get non-matching header lines as an Enumeration of Strings.MimeBodyPart.getNonMatchingHeaders
(String[] names) Return non-matching headers from this Message as an Enumeration of Header objects.MimeMessage.getNonMatchingHeaders
(String[] names) Return non-matching headers from this Message as an Enumeration of Header objects.MimeMultipart.getPreamble()
Get the preamble text, if any, that appears before the first body part of this multipart.MimeBodyPart.getRawInputStream()
Return an InputStream to the raw data with any Content-Transfer-Encoding intact.MimeMessage.getRawInputStream()
Return an InputStream to the raw data with any Content-Transfer-Encoding intact.MimeMessage.getReceivedDate()
Returns the Date on this message was received.Address[]
MimeMessage.getRecipients
(Message.RecipientType type) Returns the recepients specified by the type.Address[]
MimeMessage.getReplyTo()
Return the value of the RFC 822 "Reply-To" header field.MimeMessage.getSender()
Returns the value of the RFC 822 "Sender" header field.MimeMessage.getSentDate()
Returns the value of the RFC 822 "Date" field.int
MimeBodyPart.getSize()
Return the size of the content of this body part in bytes.int
MimeMessage.getSize()
Return the size of the content of this message in bytes.MimeMessage.getSubject()
Returns the value of the "Subject" header field.boolean
MimeMultipart.isComplete()
Return true if the final boundary line for this multipart was seen.boolean
MimeBodyPart.isMimeType
(String mimeType) Is this Part of the specified MIME type? This method compares only theprimaryType
andsubType
.boolean
MimeMessage.isMimeType
(String mimeType) Is this Part of the specified MIME type? This method compares only theprimaryType
andsubType
.boolean
MimeMessage.isSet
(Flags.Flag flag) Check whether the flag specified in theflag
argument is set in this message.void
InternetHeaders.load
(InputStream is) Read and parse the given RFC822 message stream till the blank line separating the header from the body.void
InternetHeaders.load
(InputStream is, boolean allowutf8) Read and parse the given RFC822 message stream till the blank line separating the header from the body.protected void
MimeMessage.parse
(InputStream is) Parse the InputStream setting theheaders
andcontent
fields appropriately.protected void
MimeMultipart.parse()
Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts.void
MimeMultipart.removeBodyPart
(int index) Remove the part at specified location (starting from 0).boolean
MimeMultipart.removeBodyPart
(BodyPart part) Remove the specified part from the multipart message.void
MimeBodyPart.removeHeader
(String name) Remove all headers with this name.void
MimeMessage.removeHeader
(String name) Remove all headers with this name.MimeMessage.reply
(boolean replyToAll) Get a new Message suitable for a reply to this message.MimeMessage.reply
(boolean replyToAll, boolean setAnswered) Get a new Message suitable for a reply to this message.void
MimeMessage.saveChanges()
Updates the appropriate header fields of this message to be consistent with the message's contents.void
Save the contents of this part in the specified file.void
Save the contents of this part in the specified file.void
MimeBodyPart.setContent
(Multipart mp) This method sets the body part's content to a Multipart object.void
MimeBodyPart.setContent
(Object o, String type) A convenience method for setting this body part's content.void
MimeMessage.setContent
(Multipart mp) This method sets the Message's content to a Multipart object.void
MimeMessage.setContent
(Object o, String type) A convenience method for setting this Message's content.void
MimeBodyPart.setContentID
(String cid) Set the "Content-ID" header field of this body part.void
MimeMessage.setContentID
(String cid) Set the "Content-ID" header field of this Message.void
MimeBodyPart.setContentLanguage
(String[] languages) Set the Content-Language header of this MimePart.void
MimeMessage.setContentLanguage
(String[] languages) Set the "Content-Language" header of this MimePart.void
MimePart.setContentLanguage
(String[] languages) Set the Content-Language header of this MimePart.void
MimeBodyPart.setContentMD5
(String md5) Set the "Content-MD5" header field of this body part.void
MimeMessage.setContentMD5
(String md5) Set the "Content-MD5" header field of this Message.void
MimePart.setContentMD5
(String md5) Set the Content-MD5 of this part.void
MimeBodyPart.setDataHandler
(jakarta.activation.DataHandler dh) This method provides the mechanism to set this body part's content.void
MimeMessage.setDataHandler
(jakarta.activation.DataHandler dh) This method provides the mechanism to set this part's content.void
MimeBodyPart.setDescription
(String description) Set the "Content-Description" header field for this body part.void
MimeBodyPart.setDescription
(String description, String charset) Set the "Content-Description" header field for this body part.void
MimeMessage.setDescription
(String description) Set the "Content-Description" header field for this Message.void
MimeMessage.setDescription
(String description, String charset) Set the "Content-Description" header field for this Message.void
MimeBodyPart.setDisposition
(String disposition) Set the disposition in the "Content-Disposition" header field of this body part.void
MimeMessage.setDisposition
(String disposition) Set the disposition in the "Content-Disposition" header field of this body part.void
MimeBodyPart.setFileName
(String filename) Set the filename associated with this body part, if possible.void
MimeMessage.setFileName
(String filename) Set the filename associated with this part, if possible.void
Set the flags for this message.void
MimeMessage.setFrom()
Set the RFC 822 "From" header field using the value of theInternetAddress.getLocalAddress
method.void
Set the RFC 822 "From" header field.void
Set the RFC 822 "From" header field.void
Set the value for this header_name.void
Set the value for this header_name.void
MimeMultipart.setPreamble
(String preamble) Set the preamble text to be included before the first body part.void
MimeMessage.setRecipients
(Message.RecipientType type, Address[] addresses) Set the specified recipient type to the given addresses.void
MimeMessage.setRecipients
(Message.RecipientType type, String addresses) Set the specified recipient type to the given addresses.void
MimeMessage.setReplyTo
(Address[] addresses) Set the RFC 822 "Reply-To" header field.void
Set the RFC 822 "Sender" header field.void
MimeMessage.setSentDate
(Date d) Set the RFC 822 "Date" header field.void
MimeMessage.setSubject
(String subject) Set the "Subject" header field.void
MimeMessage.setSubject
(String subject, String charset) Set the "Subject" header field.void
MimeMultipart.setSubType
(String subtype) Set the subtype.void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.void
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.void
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".void
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.void
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.protected void
MimeBodyPart.updateHeaders()
Examine the content of this body part and update the appropriate MIME headers.protected void
MimeMessage.updateHeaders()
Called by thesaveChanges
method to actually update the MIME headers.protected void
MimeMultipart.updateHeaders()
Update headers.protected void
PreencodedMimeBodyPart.updateHeaders()
Force theContent-Transfer-Encoding
header to use the encoding that was specified when this object was created.protected void
MimeMessage.updateMessageID()
Update the Message-ID header.void
MimeBodyPart.writeTo
(OutputStream os) Output the body part as an RFC 822 format stream.void
MimeMessage.writeTo
(OutputStream os) Output the message as an RFC 822 format stream.void
MimeMessage.writeTo
(OutputStream os, String[] ignoreList) Output the message as an RFC 822 format stream, without specified headers.void
MimeMultipart.writeTo
(OutputStream os) Iterates through all the parts and outputs each MIME part separated by a boundary.void
PreencodedMimeBodyPart.writeTo
(OutputStream os) Output the body part as an RFC 822 format stream.ModifierConstructorDescriptionRead and parse the given RFC822 message stream till the blank line separating the header from the body.InternetHeaders
(InputStream is, boolean allowutf8) Read and parse the given RFC822 message stream till the blank line separating the header from the body.MimeBodyPart
(InternetHeaders headers, byte[] content) Constructs a MimeBodyPart using the given header and content bytes.Constructs a MimeBodyPart by reading and parsing the data from the specified input stream.protected
MimeMessage
(Folder folder, InternetHeaders headers, byte[] content, int msgnum) Constructs a MimeMessage from the given InternetHeaders object and content.protected
MimeMessage
(Folder folder, InputStream is, int msgnum) Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.MimeMessage
(MimeMessage source) Constructs a new MimeMessage with content initialized from thesource
MimeMessage.MimeMessage
(Session session, InputStream is) Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.MimeMultipart
(jakarta.activation.DataSource ds) Constructs a MimeMultipart object and its bodyparts from the given DataSource.MimeMultipart
(BodyPart... parts) Construct a MimeMultipart object of the default "mixed" subtype, and with the given body parts.MimeMultipart
(String subtype, BodyPart... parts) Construct a MimeMultipart object of the given subtype and with the given body parts. -
Uses of MessagingException in jakarta.mail.search
Modifier and TypeClassDescriptionclass
The exception thrown when a Search expression could not be handled. -
Uses of MessagingException in org.eclipse.angus.mail.dsn
Modifier and TypeMethodDescriptionvoid
MultipartReport.addBodyPart
(BodyPart part) Adds a Part to the multipart.void
MultipartReport.addBodyPart
(BodyPart part, int index) Adds a BodyPart at positionindex
.MultipartReport.getDeliveryStatus()
Deprecated.use getReport insteadMultipartReport.getReport()
Get the report associated with this multipart/report.MultipartReport.getReturnedMessage()
Get the original message that is being returned along with this multipart/report.MultipartReport.getText()
Get the plain text to be presented to the user, if there is any.MultipartReport.getTextBodyPart()
Return the body part containing the message to be presented to the user, usually just a text/plain part.void
MultipartReport.removeBodyPart
(int index) Remove the part at specified location (starting from 0).boolean
MultipartReport.removeBodyPart
(BodyPart part) Remove the specified part from the multipart message.void
MessageHeaders.setDataHandler
(jakarta.activation.DataHandler dh) Can't set any content for a MessageHeaders object.void
MultipartReport.setDeliveryStatus
(DeliveryStatus status) Deprecated.use setReport insteadvoid
Set the report associated with this multipart/report.void
MultipartReport.setReturnedMessage
(MimeMessage msg) Set the original message to be returned as part of the multipart/report.void
MultipartReport.setSubType
(String subtype) Set the subtype.void
Set the message to be presented to the user as just a text/plain part containing the specified text.void
MultipartReport.setTextBodyPart
(MimeBodyPart mbp) Set the body part containing the text to be presented to the user.ModifierConstructorDescriptionConstruct a delivery status notification with no content.Construct a delivery status notification by parsing the supplied input stream.Construct a disposition notification with no content.Construct a disposition notification by parsing the supplied input stream.Construct a MessageHeaders object.MessageHeaders
(InternetHeaders headers) Constructs a MessageHeaders object using the given InternetHeaders.Constructs a MessageHeaders object from the given InputStream.Construct a multipart/report object with no content.MultipartReport
(jakarta.activation.DataSource ds) Constructs a MultipartReport object and its bodyparts from the given DataSource.MultipartReport
(String text, Report report) Construct a multipart/report object with the specified plain text and report type (DeliveryStatus or DispositionNotification) to be returned to the user.MultipartReport
(String text, Report report, InternetHeaders hdr) Construct a multipart/report object with the specified plain text, report, and headers from the original message to be returned to the user.MultipartReport
(String text, Report report, MimeMessage msg) Construct a multipart/report object with the specified plain text, report, and original message to be returned to the user. -
Uses of MessagingException in org.eclipse.angus.mail.gimap
Modifier and TypeMethodDescriptionString[]
GmailMessage.getLabels()
Return the Gmail labels associated with this message.long
GmailMessage.getMsgId()
Return the Gmail unique message ID.long
GmailMessage.getThrId()
Return the Gmail unique thread ID.protected boolean
GmailStore.protocolConnect
(String host, int pport, String user, String password) void
Set the specified labels for the given array of message numbers.void
Set the specified labels for the given range of message numbers.void
Set the specified labels for the given array of messages.void
Set/Unset the given labels on this message. -
Uses of MessagingException in org.eclipse.angus.mail.imap
Modifier and TypeClassDescriptionclass
A special kind of AuthenticationFailedException that indicates that the reason for the failure was an IMAP REFERRAL in the response code.Modifier and TypeMethodDescriptionvoid
Add an access control list entry to the access control list for this folder.void
void
void
IMAPMessage.addHeaderLine
(String line) Message[]
IMAPFolder.addMessages
(Message[] msgs) Append the given messages into this folder.void
IMAPMessage.addRecipients
(Message.RecipientType type, Address[] addresses) void
Add the rights specified in the ACL to the entry for the identifier specified in the ACL.void
IMAPFolder.appendMessages
(Message[] msgs) Append the given messages into this folder.org.eclipse.angus.mail.imap.AppendUID[]
IMAPFolder.appendUIDMessages
(Message[] msgs) Append the given messages into this folder.protected void
IMAPFolder.checkExists()
protected void
IMAPFolder.checkRange
(int msgno) void
IMAPFolder.close
(boolean expunge) Close this folder.void
IMAPStore.close()
Close this Store.void
IMAPFolder.copyMessages
(Message[] msgs, Folder folder) Copy the specified messages from this folder, to the specified destination.org.eclipse.angus.mail.imap.AppendUID[]
IMAPFolder.copyUIDMessages
(Message[] msgs, Folder folder) Copy the specified messages from this folder, to the specified destination.boolean
IMAPFolder.create
(int type) Create this folder, with the specified type.boolean
IMAPFolder.delete
(boolean recurse) Delete this folder.IMAPFolder.doCommand
(IMAPFolder.ProtocolCommand cmd) Execute a user-supplied IMAP command.IMAPFolder.doCommandIgnoreFailure
(IMAPFolder.ProtocolCommand cmd) IMAPFolder.doOptionalCommand
(String err, IMAPFolder.ProtocolCommand cmd) boolean
IMAPFolder.exists()
Check whether this folder really exists on the server.Message[]
IMAPFolder.expunge()
Expunge all messages marked as DELETED.Message[]
Expunge the indicated messages, which must have been marked as DELETED.void
IMAPFolder.fetch
(Message[] msgs, FetchProfile fp) Prefetch attributes, based on the given FetchProfile.protected Object
IMAPMessage.fetchItem
(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) Fetch an individual item for the current message.void
IMAPFolder.forceClose()
Close this folder without waiting for the server.ACL[]
IMAPFolder.getACL()
Get the access control list entries for this folder.IMAPMessage.getAllHeaderLines()
Get all header-lines.IMAPMessage.getAllHeaders()
Get all headers.String[]
IMAPFolder.getAttributes()
Get the attributes that the IMAP server returns with the LIST response.IMAPMessage.getContentID()
Get the Content-ID.String[]
IMAPMessage.getContentLanguage()
Get the content language.IMAPMessage.getContentMD5()
Get the Content-MD5.protected InputStream
IMAPMessage.getContentStream()
Get all the bytes for this message.IMAPMessage.getContentType()
Get the Content-Type.jakarta.activation.DataHandler
IMAPMessage.getDataHandler()
Get the DataHandler object for this message.IMAPStore.getDefaultFolder()
Get the default folder, representing the root of this user's namespace.int
IMAPFolder.getDeletedMessageCount()
Get the deleted message count.IMAPMessage.getDescription()
Get the decoded Content-Description.IMAPMessage.getDisposition()
Get the Content-Disposition.IMAPMessage.getEncoding()
Get the Content-Transfer-Encoding.IMAPMessage.getFileName()
Get the "filename" Disposition parameter.IMAPMessage.getFlags()
Get the Flags for this message.Get the named subfolder.Get named folder.Get named folder.Address[]
IMAPMessage.getFrom()
Get the "From" attribute.String[]
Get the named header.Get the named header.long
IMAPFolder.getHighestModSeq()
Returns the HIGHESTMODSEQ for this folder.IMAPMessage.getInReplyTo()
Get the In-Reply-To header.IMAPMessage.getItem
(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) Return the data associated with the FetchItem.int
IMAPMessage.getLineCount()
Get the total number of lines.IMAPMessage.getMatchingHeaderLines
(String[] names) Get all matching header-lines.IMAPMessage.getMatchingHeaders
(String[] names) Get matching headers.IMAPFolder.getMessage
(int msgnum) Get the specified message.IMAPFolder.getMessageByUID
(long uid) Get the Message corresponding to the given UID.int
IMAPFolder.getMessageCount()
Get the total message count.IMAPMessage.getMessageID()
Get the Message-ID.Message[]
IMAPFolder.getMessages()
Get all Message objects from this Folder.Message[]
IMAPFolder.getMessagesByUID
(long[] uids) Get the Messages specified by the given array.Message[]
IMAPFolder.getMessagesByUID
(long start, long end) Get the Messages specified by the given range.Message[]
IMAPFolder.getMessagesByUIDChangedSince
(long start, long end, long modseq) Get the messages that have been changed since the given MODSEQ value.IMAPMessage.getMimeStream()
Return the MIME format stream corresponding to this message.long
IMAPMessage.getModSeq()
Return the modification sequence number (MODSEQ) for this message.int
IMAPFolder.getNewMessageCount()
Get the new message count.IMAPMessage.getNonMatchingHeaderLines
(String[] names) Get all non-matching headerlines.IMAPMessage.getNonMatchingHeaders
(String[] names) Get non-matching headers.IMAPFolder.getParent()
Get this folder's parent.Folder[]
IMAPStore.getPersonalNamespaces()
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Personal namespaces.Quota[]
IMAPFolder.getQuota()
Get the quotas for the quotaroot associated with this folder.Quota[]
Get the quotas for the named quota root.IMAPMessage.getReceivedDate()
Get the received date (INTERNALDATE).Address[]
IMAPMessage.getRecipients
(Message.RecipientType type) Get the desired Recipient type.Address[]
IMAPMessage.getReplyTo()
Get the ReplyTo addresses.IMAPMessage.getSender()
Get the "Sender" attribute.IMAPMessage.getSentDate()
Get the SentDate.char
IMAPFolder.getSeparator()
Get the separator character.Folder[]
IMAPStore.getSharedNamespaces()
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Shared namespaces.int
IMAPMessage.getSize()
Get the message size.long
IMAPMessage.getSizeLong()
Get the message size as a long.Message[]
IMAPFolder.getSortedMessages
(SortTerm[] term) Sort the messages in the folder according to the sort criteria.Message[]
IMAPFolder.getSortedMessages
(SortTerm[] term, SearchTerm sterm) Sort the messages in the folder according to the sort criteria.long
IMAPFolder.getStatusItem
(String item) Use the IMAP STATUS command to get the indicated item.IMAPMessage.getSubject()
Get the decoded subject.int
IMAPFolder.getType()
Get the type of this folder.long
Get the UID for the specified message.long
IMAPFolder.getUIDNext()
Returns the predicted UID that will be assigned to the next message that is appended to this folder.boolean
IMAPFolder.getUIDNotSticky()
Servers that support the UIDPLUS extension (RFC 4315) may indicate that this folder does not support persistent UIDs; that is, UIDVALIDITY will be different each time the folder is opened.long
IMAPFolder.getUIDValidity()
Returns the UIDValidity for this folder.int
IMAPFolder.getUnreadMessageCount()
Get the unread message count.Folder[]
IMAPStore.getUserNamespaces
(String user) Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the User's namespaces.protected boolean
IMAPMessage.handleFetchItem
(org.eclipse.angus.mail.imap.protocol.Item item, String[] hdrs, boolean allHeaders) Apply the data in the FETCH item to this message.boolean
IMAPStore.hasCapability
(String capability) Return true if the specified capability string is in the list of capabilities the server announced.boolean
IMAPFolder.hasNewMessages()
Check whether this folder has new messages.Send the IMAP ID command (if supported by the server) and return the result from the server.Send the IMAP ID command (if supported by the server) and return the result from the server.void
IMAPFolder.idle()
Use the IMAP IDLE command (see RFC 2177), if supported by the server, to enter idle mode so that the server can send unsolicited notifications of new messages arriving, etc.void
IMAPFolder.idle
(boolean once) LikeIMAPFolder.idle()
, but ifonce
is true, abort the IDLE command after the first notification, to allow the caller to process any notification synchronously.void
IMAPStore.idle()
Use the IMAP IDLE command (see RFC 2177), if supported by the server, to enter idle mode so that the server can send unsolicited notifications without the need for the client to constantly poll the server.boolean
IMAPMessage.isSet
(Flags.Flag flag) Test if the given Flags are set in this message.Folder[]
List all subfolders matching the specified pattern.Rights[]
IMAPFolder.listRights
(String name) Get all the rights that may be allowed to the given identifier.Folder[]
IMAPFolder.listSubscribed
(String pattern) List all subscribed subfolders matching the specified pattern.void
IMAPFolder.moveMessages
(Message[] msgs, Folder folder) Move the specified messages from this folder, to the specified destination.org.eclipse.angus.mail.imap.AppendUID[]
IMAPFolder.moveUIDMessages
(Message[] msgs, Folder folder) Move the specified messages from this folder, to the specified destination.IMAPFolder.myRights()
Get the rights allowed to the currently authenticated user.void
IMAPFolder.open
(int mode) Open this folder in the given mode.IMAPFolder.open
(int mode, ResyncData rd) Open this folder in the given mode, with the given resynchronization data.protected boolean
IMAPStore.protocolConnect
(String host, int pport, String user, String password) Implementation of protocolConnect().void
Remove any access control list entry for the given identifier from the access control list for this folder.void
IMAPMessage.removeHeader
(String name) void
IMAPFolder.removeRights
(ACL acl) Remove the rights specified in the ACL from the entry for the identifier specified in the ACL.boolean
Rename this folder.Message[]
IMAPFolder.search
(SearchTerm term) Search whole folder for messages matching the given term.Message[]
IMAPFolder.search
(SearchTerm term, Message[] msgs) Search the folder for messages matching the given term.void
IMAPMessage.setContentID
(String cid) void
IMAPMessage.setContentLanguage
(String[] languages) void
IMAPMessage.setContentMD5
(String md5) void
IMAPMessage.setDataHandler
(jakarta.activation.DataHandler content) void
IMAPMessage.setDescription
(String description, String charset) void
IMAPMessage.setDisposition
(String disposition) void
IMAPMessage.setFileName
(String filename) void
Set the specified flags for the given array of message numbers.void
Set the specified flags for the given range of message numbers.void
Set the specified flags for the given array of messages.void
Set/Unset the given flags in this message.void
void
void
Set the quotas for the quotaroot specified in the quota argument.void
Set the quotas for the quota root specified in the quota argument.void
IMAPMessage.setRecipients
(Message.RecipientType type, Address[] addresses) void
IMAPMessage.setReplyTo
(Address[] addresses) void
void
IMAPMessage.setSentDate
(Date d) void
IMAPMessage.setSubject
(String subject, String charset) void
IMAPFolder.setSubscribed
(boolean subscribe) Subscribe/Unsubscribe this folder.void
Watch the Folder for new messages and other events using the IMAP IDLE command.void
IMAPMessage.writeTo
(OutputStream os) Write out the bytes into the given OutputStream. -
Uses of MessagingException in org.eclipse.angus.mail.pop3
Modifier and TypeMethodDescriptionvoid
Add this value to the existing values for this header_name.void
POP3Message.addHeaderLine
(String line) Add a raw RFC822 header-line.void
POP3Folder.appendMessages
(Message[] msgs) Always throwsMethodNotSupportedException
because the POP3 protocol doesn't support appending messages.POP3Store.capabilities()
Return a Map of the capabilities the server provided, as per RFC 2449.void
POP3Folder.close
(boolean expunge) void
POP3Store.close()
boolean
POP3Folder.create
(int type) Always returnsfalse
; the POP3 protocol doesn't support creating folders.protected POP3Message
POP3Folder.createMessage
(Folder f, int msgno) boolean
POP3Folder.delete
(boolean recurse) Always throwsMethodNotSupportedException
because the POP3 protocol doesn't allow the INBOX to be deleted.Message[]
POP3Folder.expunge()
Always throwsMethodNotSupportedException
because the POP3 protocol doesn't support expunging messages without closing the folder; call theclose
method with theexpunge
argument set totrue
instead.void
POP3Folder.fetch
(Message[] msgs, FetchProfile fp) Prefetch information about POP3 messages.POP3Message.getAllHeaderLines()
Get all header lines as an Enumeration of Strings.POP3Message.getAllHeaders()
Return all the headers from this Message as an enumeration of Header objects.protected InputStream
POP3Message.getContentStream()
Produce the raw bytes of the content.POP3Store.getDefaultFolder()
Always throwsMessagingException
because no POP3 folders can contain subfolders.Only the name "INBOX" is supported.String[]
Get all the headers for this header_name.Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.POP3Message.getMatchingHeaderLines
(String[] names) Get matching header lines as an Enumeration of Strings.POP3Message.getMatchingHeaders
(String[] names) Return matching headers from this Message as an Enumeration of Header objects.POP3Folder.getMessage
(int msgno) int
POP3Folder.getMessageCount()
Will not change while the folder is open because the POP3 protocol doesn't support notification of new messages arriving in open folders.POP3Message.getMimeStream()
Return the MIME format stream corresponding to this message part.POP3Message.getNonMatchingHeaderLines
(String[] names) Get non-matching header lines as an Enumeration of Strings.POP3Message.getNonMatchingHeaders
(String[] names) Return non-matching headers from this Message as an Enumeration of Header objects.int
POP3Folder.getSize()
Return the size of this folder, as was returned by the POP3 STAT command when this folder was opened.int
POP3Message.getSize()
Return the size of the content of this message in bytes.int[]
POP3Folder.getSizes()
Return the sizes of all messages in this folder, as returned by the POP3 LIST command.Return the unique ID string for this message, or null if not available.boolean
POP3Folder.hasNewMessages()
Always returnsfalse
; the POP3 protocol provides no way to determine when a new message arrives.Folder[]
Always throwsMessagingException
because no POP3 folders can contain subfolders.POP3Folder.listCommand()
Return the raw results of the POP3 LIST command with no arguments.void
POP3Folder.open
(int mode) ThrowsFolderNotFoundException
unless this folder is named "INBOX".protected boolean
POP3Store.protocolConnect
(String host, int portNum, String user, String passwd) void
POP3Message.removeHeader
(String name) Remove all headers with this name.boolean
Always throwsMethodNotSupportedException
because the POP3 protocol doesn't support multiple folders.void
POP3Message.saveChanges()
POP3 message can't be changed.void
Set the specified flags on this message to the specified value.void
Set the value for this header_name.POP3Message.top
(int n) Fetch the header of the message and the firstn
lines of the raw content of the message.void
POP3Message.writeTo
(OutputStream os, String[] ignoreList) Output the message as an RFC 822 format stream, without specified headers. -
Uses of MessagingException in org.eclipse.angus.mail.smtp
Modifier and TypeClassDescriptionclass
This exception is thrown when the message cannot be sent.class
This exception is chained off a SendFailedException when themail.smtp.reportsuccess
property is true.class
This exception is thrown when the message cannot be sent.class
This exception is thrown when the message cannot be sent.Modifier and TypeMethodDescriptionprotected OutputStream
SMTPTransport.bdat()
Return a stream that will use the SMTP BDAT command to send data.void
SMTPTransport.close()
Close the Transport and terminate the connection to the server.void
Start the SMTP protocol on the given socket, which was already connected by the caller.protected OutputStream
SMTPTransport.data()
Send theDATA
command to the SMTP host and return an OutputStream to which the data is to be written.protected boolean
Issue theEHLO
command.protected void
SMTPTransport.finishBdat()
Terminate the sent data.protected void
SMTPTransport.finishData()
Terminate the sent data.protected void
Issue theHELO
command.void
SMTPTransport.issueCommand
(String cmd, int expect) Send the command to the server.protected void
SMTPTransport.mailFrom()
Issue theMAIL FROM:
command to start sending a message.protected boolean
SMTPTransport.protocolConnect
(String host, int port, String user, String password) Performs the actual protocol-specific connection attempt.protected void
SMTPTransport.rcptTo()
Sends each address to the SMTP host using theRCPT TO:
command and copies the address either into the validSentAddr or invalidAddr arrays.protected int
SMTPTransport.readServerResponse()
Reads server reponse returning thereturnCode
as the number.protected void
SMTPTransport.sendCommand
(String cmd) Sends commandcmd
to the server terminating it withCRLF
.void
SMTPTransport.sendMessage
(Message message, Address[] addresses) Send the Message to the specified list of addresses.protected int
SMTPTransport.simpleCommand
(byte[] cmd) Send the command to the server and return the response code from the server.int
SMTPTransport.simpleCommand
(String cmd) Send the command to the server and return the response code from the server.protected void
SMTPTransport.startTLS()
Issue theSTARTTLS
command and switch the socket to TLS mode if it succeeds.ModifierConstructorDescriptionSMTPMessage
(MimeMessage source) Constructs a new SMTPMessage with content initialized from thesource
MimeMessage.SMTPMessage
(Session session, InputStream is) Constructs an SMTPMessage by reading and parsing the data from the specified MIME InputStream. -
Uses of MessagingException in org.eclipse.angus.mail.util
Modifier and TypeClassDescriptionclass
A MessagingException that indicates a socket connection attempt failed.Modifier and TypeMethodDescriptionReadableMime.getMimeStream()
Return the MIME format stream corresponding to this message part.