What is the best way to launch the default e-mail editor from a Java Application. Can a new message be automatically sent to the editor?

Serge Knystautas

There is no standard way to launch the default e-mail editor from a Java Application. If you were in a Java Applet, you could leverage the showDocument() method of AppletContext and pass it a mailto: protocol. If you could do this, in addition to specifying the target, you could specify the initial subject and body with command line parameters, e.g., mailto:address@domain.com?subject=My%20Subject&body=The%20body%20of%20my%20message.

Again however, there is no standard way to launch an external application like an e-mail editor from a Java Application. If you want to check that you are running in Windows 95/98/NT/2k, you could access the Runtime object and use its exec() method to run start mailto:address@domain.com?subject=...... This OS-specific command instructs Windows to open the default e-mail editor and create a new message with the given destination and subject.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact