Link to home
Start Free TrialLog in
Avatar of rimmer0007
rimmer0007

asked on

email

dont know if this is relevant to java but here goes

i have opened a web site in a Jeditorpane, how can i click on a email address and open up say outlook express 6 ?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Add a HyperlinkListener and Runtime.exec OE.
to start up the mail client try:

Runtime.getRuntime().exec("cmd.exe /C start mailto:xxx@yyy.com");    
your listener would look something like:

public class MyHyperlinkListener implements HyperlinkListener
{
   public void hyperlinkUpdate(HyperlinkEvent e)
   {
       URL url = e.getURL();
       if (url.getProtocol().startsWith("mailto"))
       {
          Runtime.getRuntime().exec("cmd.exe /C start "+url);    
       }
   }
}

 
Start the program in a separate thread in the listener - it should not be executed in the event handling thread
>> it should not be executed in the event handling thread

Should it matter if we're not using waitFor () ?