Send out email in Java
Description
The following code shows how to send out email.
Example
/*from ww w . j av a 2s . c om*/
import java.awt.Desktop;
import java.net.URI;
public class Main {
public static void main(String[] a)throws Exception {
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
desktop.mail(new URI("mailto:a@a.net"));
}
}
The code above generates the following result.