Desktop.mail() has the following syntax.
public void mail() throws IOException
In the following code shows how to use Desktop.mail() method.
import java.awt.Desktop; //www. ja v a 2 s. c o m public class Main { public static void main(String[] a)throws Exception { Desktop desktop = null; if (Desktop.isDesktopSupported()) { desktop = Desktop.getDesktop(); } desktop.mail(); } }