Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

launch MS outlook with attachment in email

807603Jul 5 2005 — edited Jan 29 2008
working 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2008
Added on Jul 5 2005
25 comments
4,858 views