The code below opens up Outlook Email as soon as a button is pressed. Is there a way to automatically attach a file to the mail as well along with a subject possibly?
public void onSubmit() {
try {
Desktop.getDesktop().browse(new URI("mailto:username@domain.com"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
I tried changing the Desktop line to this. Should this work? Its not compiling though:
Desktop.getDesktop().browse(new URI('mailto:username@domain.com?subject=New_Profile&body=see attachment&attachment="xyz.xml"'));