java开源邮件_Mail开源库JavaMail
下⾯是官⽅⽹站对于JavaMail的主要描述:The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API is available as an optional package for use with Java SE platform and is also included in the Java EE platform.
从官⽅描述来看,JavaMail可以⽤于Java SE平台和Java EE平台。
下⾯是⼀些从官⽅FAQ摘录出来的⼏条有⽤的信息。
Q: What is the JavaMail API?
A: The JavaMail API is a set of abstract APIs that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology based email client applications. The JavaMail API provides
facilities for reading and sending email. Service providers implement particular protocols. Several service providers are included with the JavaMail API package; others are available separately. The JavaMail API is implemented as a Java optional package that can be used on JDK 1.4 and later on any
operating system. The JavaMail API is also a required part of the Java Platform, Enterprise Edition (Java EE).
Q: How do I get an implementation of the JavaMail API?
A: Sun provides a royalty-free reference implementation, in binary form, that developers may use and ship. The reference implementation includes the core JavaMail packages and IMAP, POP3, and SMTP service providers. The reference implementation may be downloaded here.
Q: What JDK does the JavaMail API need?
A: The JavaMail API requires JDK/JRE 1.4 or higher. The JavaMail API is a Java optional package, it is not part of the core Java SE but is included in Java EE.java技术介绍百度百科
下⾯是来⾃百度百科的介绍,可能不够准确,但是基本可以看出JavaMail的功能了:
JavaMail,顾名思义,提供给开发者处理电⼦邮件相关的编程接⼝。它是Sun发布的⽤来处理email的API。它可以⽅便地执⾏⼀些常⽤的邮件传输。我们可以基于JavaMail开发出类似于Microsoft Outlook的应⽤程序。
虽然JavaMail是Sun的API之⼀,但它⽬前还没有被加在标准的java开发⼯具包中(Java Development Kit),这就意味着你在使⽤前必须另外下载JavaMail⽂件。除此以外,你还需要有Sun的JavaBeans Activation Framework(JAF)。JavaBeans Activation Framework的运⾏很复杂,在这⾥简单的说就是JavaMail的运⾏必须得依赖于它的⽀持。在Windows 2000下使⽤需要指定这些⽂件的路径,在其它的操作系统上也类似。
JavaMail是可选包,因此如果需要使⽤的话你需要⾸先从java.sun下载。⽬前最新版本是JavaMail1.4,使⽤JavaMail的时候需要Javabean Activation Framework的⽀持,因此你也需要下载JAF。安装JavaMail只是需要把他们加⼊到CLASSPATH中去,如果你不想修改CLASSPATH的话,可以直接把他们的jar包直接copy到JAVA_HOME/lib/ext下。这样JavaMail就安装好了。
JavaMail⽀持Smtp,Pop3,Imap协议,但是需要注意的是,它不能直接⽤于Java ME平台下。但是经过研究,发现可以简单删除部分边缘类,然后就可以在Java ME平台下使⽤了。
原⽂链接:
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论