I would like to send a webpage to Outlook from Java but without initially specifying the person to whom I am sending it too. In short, I would like to implement Internet Explorer's functionality of sending a web page by email. I currently can't figure this out.
This is what I have tried but it's not working, it gives the error :
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: URI scheme is not "mailto"
This is my code :
File htmlFile = new File("http://stackoverflow.com/questions/ask");
try {
Desktop.getDesktop().mail( htmlFile.toURI() );
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}