Oct
03
|
The Desktop class was added in Java 6 to handle launching associated applications on the native desktop.
Following shows how to launch the default mail application and open a mail composing window.
Desktop desktop = Desktop.getDesktop(); desktop.mail();
Or you can use a mailto: URI to also fill out the address field.
Desktop desktop = Desktop.getDesktop(); desktop.mail(new URI("mailto:someone@acme.com"));
Array ( ) 2 Responses to “How to launch default mail application with Java 6”
Leave a Reply
You must be logged in to post a comment.
November 13th, 2009 at 1:26 am
Thanks,
It is useful.
How do I add attachments to the mail before I open the mail application?
(using the code)
November 21st, 2009 at 9:00 am
I do not believe it is possible to add attachments using this technique.