JavaMail Section Index | Page 2
Does JavaMail support accessing the preamble of a message?
JavaMail 1.4 adds get/setPreamble() methods to the MimeMultipart class. Some protocols like IMAP will not allow access to this text.
How can an application dynamically register protocol providers?
JavaMail 1.4 adds a new constructor public Provider(Type type, String protocol, String classname, String vendor, String version) for just such a need. You also need to use the new public void addP...more
How can I customize the method of Message-ID generation?
Starting with JavaMail 1.4, you can take advantage of the protected updateMessageID() method in your custom subclass of MimeMessage.
How can I work with quotas without limiting myself to IMAP specific APIs?
See the QuotaAwareStore interface added to JavaMail 1.4. It is a new interface that the actual IMAP Store implements.
How do I find out the IMAP folder separator character?
Use the getSeparator() method of Folder, instead of checking if the folder exists first.
How do I fold/unfold long header lines?
Use the fold() and unfold() methods of MimeUtility, added to JavaMail 1.4. Previosly, the methods were present, but private.
How do you allow applications to dynamically register address type mappings?
See the public void setProtocolForAddress(String addresstype, String protocol) method of Session added to JavaMail 1.4.
How do you encode non-ASCII parameters in MIME headers?
If the mail.mime.encodeparameters System property is set to "true". non-ASCII parameters will be encoded per RFC 2231.
If the mail.mime.decodeparameters System property is set to "true". parameter...more
How do you specify the character set to use for a parameter?
Added to JavaMail 1.4, see the new public void set(String name, String value, String charset) method of ParameterList.
My attachment data is already base64 encoded, how do I avoid it being double encoded?
Use the new PreencodedMimeBodyPart class, added to JavaMail 1.4.
Where can I find out more about the features new to the 1.4 release of JavaMail?
JSR 919, http://jcp.org/en/jsr/detail?id=919 includes the information on the API changes for this release.
Is there support for the IMAP IDLE command in JavaMail?
Until now, no. Support is coming in the 1.4.1 release of JavaMail. You can try out an early access version at https://maven-repository.dev.java.net/nonav/repository/javax.mail/.more
How you can know that two parts in an email (typically a text/plain and text/html) are the same thing?
The parts will be contained in a multipart/alternative.
How can I list the name of the files attached to a message without invoking getBodyPart()?
Short answer: You can't.
Longer answer: You can discover all the multipart messages without calling getBodyPart(), but you can't tell if those messages actually contain attachments, and you defin...more
How do I use the default mail client to send an email?
The Java 6 Desktop class has a mail() method for just such an action.