launch MS outlook with attachment in email
807603Jul 5 2005 — edited Jan 29 2008working on jdk 1.5 need to launch MS outlook with new email having attachment with it. here is the code i have written for the same. The code opens the MS outlook but i am not able to attach the file with the same. any ideas how to proceed for the same?
try {
String stLineSep; // String containing the system line separator
// Line separator:
stLineSep = System.getProperty("line.separator"); // Get it
Runtime.getRuntime().exec(
new String[] {"rundll32",
"url.dll,FileProtocolHandler",
"mailto:" + "&attachment=" + "c:\\rohit.txt"}
);//","attachment;filename="+strFileName
}
catch (Exception ex) {
ex.printStackTrace();
}
Thanks,
rdh