2009-10-14 38 views

回答

0

JDIC提供了一些功能来做到这一点。尽管JDIC中的大部分被Java6中的java.awt.Desktop吸收,但它并未包含电子邮件组成位。不幸的是,JDIC二进制文件随着transition of java.net to the Kenai platform消失;我上传了我能找到的项目JIRA的最新版本。

JDIC在OSGi中不能很好地运行,所以我最近将相关的MAPI位提取到名为jmapi的包中。

+0

我试过JDIC工作,但是得到以下错误:'抛出java.lang.ClassNotFoundException:org.jdesktop。 jdic.desktop.internal.impl.ServiceManagerStub_unix'需要帮助。 – vissu 2013-01-10 12:33:27

2

如果这是一个客户端应用程序,你可以看看在java.awt.Desktop 类。

根据JavaDoc ...

Launches the mail composing window of the user default mail client, filling the message fields specified by a mailto: URI.

A mailto: URI can specify message fields including "to", "cc", "subject", "body", etc. See The mailto URL scheme (RFC 2368) for the mailto: URI specification details.

这不会让你附加文件,但它会打开用户的邮件客户端。

此链接可能会有所帮助...... Using the Desktop API in Java SE 6