Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Email through "Program.launch"(How to open the mail editor through "Program.launch" ?)
Email through "Program.launch" [message #496057] Sat, 07 November 2009 17:32 Go to next message
xloiseau is currently offline xloiseau
Messages: 7
Registered: July 2009
Junior Member
Hi,

In an RCP application, I try to programmatically open
the default external email editor through the following Java line:

boolean result = Program.launch("mailto:name@domain.com");

Unexpectedly, nothing happens and the result is false !

Here is a description of my platform:
- JRE: 1.5.020
- OS: Mac OS X 10.5.8 PowerPC
- RCP: Galileo

Notice that the following command is successful in a terminal:
open mailto:name@domain.com

Has anybody already noticed this issue ?

Does anybody know how to solve this issue ?

I am looking for a solution portable on different OS.

Thank you very much for your help.

Xav
Re: Email through "Program.launch" [message #496138 is a reply to message #496057] Mon, 09 November 2009 01:18 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Xav,

If the input on the command line is "open mailto:mailto:name@domain.com"
shouldn't that be the same in the ProgramLaunch argument?

Best regards,

Wim


> Hi,
>
> In an RCP application, I try to programmatically open
> the default external email editor through the following Java line:
>
> boolean result = Program.launch("mailto:mailto:name@domain.com");
>
> Unexpectedly, nothing happens and the result is false !
>
> Here is a description of my platform:
> - JRE: 1.5.020
> - OS: Mac OS X 10.5.8 PowerPC
> - RCP: Galileo
>
> Notice that the following command is successful in a terminal:
> open mailto:mailto:name@domain.com
>
> Has anybody already noticed this issue ?
>
> Does anybody know how to solve this issue ?
>
> I am looking for a solution portable on different OS.
>
> Thank you very much for your help.
>
> Xav
Re: Email through "Program.launch" [message #496241 is a reply to message #496138] Mon, 09 November 2009 13:05 Go to previous messageGo to next message
xloiseau is currently offline xloiseau
Messages: 7
Registered: July 2009
Junior Member
Hi Wim,

Thank you for your answer !

I also tried the following Java line:
boolean result = Program.launch("open mailto:name@domain.com");

But it does not work either !

Does anybody have any other idea ?

Thank you very much for your help.

Xav
Re: Email through "Program.launch" [message #496243 is a reply to message #496241] Mon, 09 November 2009 13:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5419
Registered: July 2009
Senior Member
Why not use JDK-ProcessBuilder?

Tom

xloiseau schrieb:
> Hi Wim,
>
> Thank you for your answer !
>
> I also tried the following Java line:
> boolean result = Program.launch("open mailto:mailto:name@domain.com");
>
> But it does not work either !
> Does anybody have any other idea ?
>
> Thank you very much for your help.
>
> Xav
>
Re: Email through "Program.launch" [message #496249 is a reply to message #496243] Mon, 09 November 2009 13:34 Go to previous messageGo to next message
xloiseau is currently offline xloiseau
Messages: 7
Registered: July 2009
Junior Member
Hi Tom,

Thank you for your answer !

I do not want to provide an explicit system command
since I would rather have a platform-independent solution.

In other words, I only want to provide a "mailto" URI and
automatically have the default email editor launched.

Any other idea ?

Xav
Re: Email through "Program.launch" [message #496255 is a reply to message #496249] Mon, 09 November 2009 14:08 Go to previous messageGo to next message
T. Wilhelm is currently offline T. Wilhelm
Messages: 129
Registered: July 2009
Senior Member
Did you try use:


Desktop.getDesktop().mail(mailtoURI);



Greetz
Thomas
Re: Email through "Program.launch" [message #496298 is a reply to message #496255] Mon, 09 November 2009 16:00 Go to previous message
xloiseau is currently offline xloiseau
Messages: 7
Registered: July 2009
Junior Member
Hi Thomas,

Thank you for your solution, it works !

I had to move my RCP application to a Mac OS X Intel since:
- The "Desktop" class is available since JRE 1.6 and
- There is not any JRE 1.6 available for the Mac OS X PowerPC.

But this move is acceptable in my context.

Thank you very much for your help !

Xav
Previous Topic:work with read only data location
Next Topic:Search menu trouble
Goto Forum:
  


Current Time: Thu Oct 23 17:28:49 GMT 2014

Powered by FUDForum. Page generated in 0.09478 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software