Created
December 6, 2013 16:34
-
-
Save oxtoacart/7827829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Desktop; | |
import java.net.URI; | |
import java.net.URLEncoder; | |
public class TestMailto { | |
public static void main(String[] args) throws Exception { | |
String recipient = "ox@getlantern.org"; | |
String subject = URLEncoder | |
.encode("Join the Lantern Network to Circumvent Censorship"); | |
String body = URLEncoder | |
.encode("You can download lantern from http://getlantern.org (should replace this with custom installer URL)."); | |
Desktop.getDesktop().mail( | |
new URI(String.format("mailto:%1$s?subject=%2$s&body=%3$s", | |
recipient, subject, | |
body))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment