I have written a code in order to be able to launch the default email service provider which is outlook for me. this is the code i have:
if(role.getValue().equals("1")) {
Desktop desktop = Desktop.getDesktop();
String message = "mailto:username@domain.com?subject=New_Profile&body=NewProfile";
try {
desktop.mail(uri);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
I am trying to attach something to the email automatically but its not working. Instead, will it be possibly to retrieve some data from input fields in my program and automatically add that data as body to the email?
I tried embedding a statement somehow, but its not working. could someone please advise?
Desktop desktop = Desktop.getDesktop();
String message = "mailto:username@domain.com?subject=New_Profile&body=person.getPdfName()";
Why would the code above not do anything? Is person.getPdfName() misplaced?