Send out email : Desktop « JDK 6 « Java






Send out email

  

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;

public class Test {
  public static void main(String[] a)throws Exception {
      Desktop desktop = null;
      if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
      }

       desktop.mail("mailto", "a@a.net", null);
  }
}

          
  








Related examples in the same category

1.Using the Desktop class to launch a URL with default browser
2.Invoke the default editor to edit a file
3.Using the system default setting to open a file
4.Open a office word file with Java
5.Using system default printer to print a file out
6.Open Mail client
7.Desktop Help Applications
8.This program demonstrates the desktop app API.