Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

singhkanhaiya

macrumors newbie
Original poster
My aim is to open default email client on MAC OSX and Linex from java application.

On the linex machine i am able to open the default email client using the below code.

String[] sendEmail = {xdgEmailCommand, "--subject", Subject, "--attach", path, "mail@yahoo.com"};

currentRuntime = Runtime.getRuntime();
currentRuntime.exec(sendEmail );

Looking to above can you plz suggect something that I can do on MAC OSX.
 
You can use the open command in a similar fashion. Shell out as with your current code.

The xdgEmailCommand is "open" and it takes a single argument. The get it to send a mail in the default client use a mailto: syntax like this:

mailto:user@domain?subject=subject

You can test this using the Terminal to get the syntax/escapes for spaces etc correct...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.