Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending a mail using Outlook

0 views
Skip to first unread message

Jimmy Gagnon

unread,
May 27, 2002, 9:14:14 PM5/27/02
to
This is my problem:

I want to create a new mail using outlook or any default mail sender
on a computer which uses my java application. My email is on my about
dialog. the user click on my email -- JLabel generating a MouseEvent
-- and I create a new process:

public void mouseClicked(MouseEvent e)
{
String email = "ke...@hotmail.com";
try
{
Process p = Runtime.getRuntime().exec("mailto:" + email);
}
catch (IOException ioe)
{
ioe.printStackTrace(System.out);
}
}

and this is the error which is returned:

java.io.IOException: CreateProcess: mailto:ke...@hotmail.com error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:550)
at java.lang.Runtime.exec(Runtime.java:416)
at java.lang.Runtime.exec(Runtime.java:358)
at java.lang.Runtime.exec(Runtime.java:322)
at graphism.listeners.DialogAboutListener.mouseClicked(DialogAboutListener.java:31)

If I use the command line for Outlook to create a new mail --
"C:\Program Files\Outlook Express\msimn.exe" /mailurl:ke...@hotmail.com
-- the window for mail creation is opened but the mail doesn't appear
into the "to:" TextBox.

Can someone help me?

0 new messages