JAF is now bundled with the JDK (Java Development Kit) 1.6. If you are using an older Java, to install JAF, open the download with WinZip and extract all files with folder names to the Program Files directory of some drive. Ditto for JavaMail. As of Java version 1.6, JAF is bundled with the JDK. Then make sure J:\Program Files\jaf-1.1\activation.jar and J:\Program Files\javamail-1.4.5\mail.jar are explicitly mentioned in your classpath, (not just in a classpath directory!). Alternatively, add the jars to the ext directory.
You won’t likely directly use the JAF java.activation package, but JavaMail uses them. JavaMail also comes bundled with JavaEE.
Look on your local hard disk in the JavaMail downloaded docs J:\Program Files\javamail-1.4.5\docs\javadocs\index.html or
JavaMail also supports Google Gmail and Yahoo mail.
The
If you get a Message, you can’t close the Folder or Session until you are completely finished grabbing fields for the Message. Once the Session is gone, you can’t get any additional information about the Message. This is not that unusual, but it means you can’t write a method to return a Message object unless either:
Similarly you need to hold Folder and Session open in order to be able to later delete the Message from the server.
Most JavaMail applications involve reading a message and modifying it in some way and sending it on. Most mail servers will not permit you to modify the incoming message. You must create a new one and copy the parts over. There are three techniques you can use to copy.
You probably want to use transport.sendMessage ( message, recipients ), not Transport. send( message );
Often
message.setFlag( Flags.Flag.SEEN, true ); message.setFlag( Flags.Flag.DELETED, true );I have not yet tracked down why. I suspect it may be that the Session, Folder or MimeMessage times out if you wait too long.
JavaMail is does not provide a mailserver. You might use something like James rather that using your ISP (Internet Service Provider) ’s mailserver.
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/javamail.html | J:\mindprod\jgloss\javamail.html | |
![]() | Please email your feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording,
broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.210] | |
| Feedback | You are visitor number 57,947. | |