opening default mail client
-
Hi, I am invoking my mail client using following piece of code. The code opens the mail client having a subject and a file attached with it. Note: Following piece of code is written in java, i hope the same follows for vc also. String strLicensePath = "c:\\rohit.txt"; try { Runtime.getRuntime().exec( new String[] {"rundll32", "url.dll,FileProtocolHandler", "mailto:" + "&subject=" + "TEST_STRING" + "&attachment=" + "\""+ strLicensePath + "\""} ); } catch (Exception ex) { ex.printStackTrace(); } The above code works fine on my machine having "Microsoft Outlook 2000 SP-3" installed. But gives following error on machine having Microsoft Outlook 2002 installed: "The command line argument is not valid. Verify the switch you are using." Also, the problem is coming in some of other machines also. Am I using wrong switches, i.e. arguments?? Or is there any alternative way to achieve the same. Please comment.