opening outlook express

N

Niall

Hey Im writeing a server app, and one option I was hopeing to include was
opening up outlook express, with the email address and a message included,
or even just call outlook express. I would really apreceate any idea's for
this

Thanking you
Niall Mulhare
 
C

Christophe Vanfleteren

Niall said:
Hey Im writeing a server app, and one option I was hopeing to include was
opening up outlook express, with the email address and a message included,
or even just call outlook express. I would really apreceate any idea's for
this

Thanking you
Niall Mulhare

what about those that are fortunate enough not to have Outlook installed on
their box?

Anyway, you can use something like this in your html:
<a href="mailto:user@host?subject=some%20subject">
mail me</a>
 
N

Niall

well, to dose without outlook express, im in envey. But for the moment i
will suffer it and whats more try to use it!!!

it's not for an html program it's just a standerd app.
 
C

Christophe Vanfleteren

Niall said:
well, to dose without outlook express, im in envey. But for the moment i
will suffer it and whats more try to use it!!!

it's not for an html program it's just a standerd app.

You said it was for a server app in your OP.

Anyway, if you want to invoke Outlook form your program, look at
Runtime.exec().
Also, you might not want to hardcode such things, as other programs will be
used on other platforms.

You could also look at using JavaMail to send the mail directly from in your
program.
 
P

Pimousse

Hey Im writeing a server app, and one option I was hopeing to include was
opening up outlook express, with the email address and a message included,
or even just call outlook express. I would really apreceate any idea's for
this

hi,

I'm using that in an applet :
getAppletContext().showDocument(myURL,"_blank");

where myURL is java.net.URL : myURL="mailto:[email protected]?subject=new mail";

it may be tanslated for your program ....

@++
Pimousse
 
A

Andrew Thompson

Hey Im writeing a server app, and one
option I was hopeing to include was
opening up outlook express,

How does that work on Mac's, ..under Linux,
Solaris, Win PC's on which the user has a
different default mail program?

You might be better off using the Java
classes to create and send messages, I
hear it is not hard (have not tried it
myself though).
 
N

Niall

Thanks, and I understand, that it wont run throught any other OS, but
unfortunately I have to use outlook, and heres another problem, the way im
using it is
Runtime.getRuntime().exec("C:\Program Files\Outlook Express\msimn.exe");

but it wont alow "\" char's obviously so dose anyone know away around
this??
 
C

Christophe Vanfleteren

Niall said:
Thanks, and I understand, that it wont run throught any other OS, but
unfortunately I have to use outlook, and heres another problem, the way im
using it is
Runtime.getRuntime().exec("C:\Program Files\Outlook Express\msimn.exe");

but it wont alow "\" char's obviously so dose anyone know away around
this??

Since \ is the escape character in java, you need to escape it again, so it
becomes just another character:

Runtime.getRuntime().exec("C:\\Program Files\\Outlook Express\\msimn.exe");

Btw, this code will even break on systems where the systemroot is not c:\
 
A

Andrew Thompson

Thanks, and I understand, that it wont run throught any other OS, but
unfortunately I have to use outlook, and heres another problem, the way im
using it is
Runtime.getRuntime().exec("C:\Program Files\Outlook Express\msimn.exe");

but it wont alow "\" char's obviously so dose anyone know away around
this??

Probably many of the posters to this group..
<http://www.physci.org/codes/javafaq.jsp#cljh>

Try some of these..
<http://google.com/groups?q=escape&meta=group=comp.lang.java.help>
 
A

Andrew Thompson

Btw, this code will even break on
systems where the systemroot is not c:\

Good point, I would give Pimousse's
suggestion, using the applet, a better
chance of working.

And that is taking into account some
browsers will not have Java. ;-)
 
T

Tim Ward

Niall said:
Thanks, and I understand, that it wont run throught any other OS, but
unfortunately I have to use outlook, and heres another problem, the way im
using it is
Runtime.getRuntime().exec("C:\Program Files\Outlook Express\msimn.exe");

Well, are you talking about Outlook or Outlook Express, these being totally
and utterly different products? You say "outlook express" in the subject,
which is consistent with "msimn.exe" ni the example code, but you also say
"I have to use outlook".

If you are using Outlook, rather than Outlook Express, then Outlook exposes
an object model (or three) which you can get at through normal Windows
mechanisms without any nonsense about trying to guess what the executable is
called or where it might be stored. Outlook Express doesn't.
 
C

Chris Smith

Andrew said:
Good point, I would give Pimousse's
suggestion, using the applet, a better
chance of working.

And that is taking into account some
browsers will not have Java. ;-)

You can't really compare the two anyway. The applet answer runs on a
client and is served by a web server. The Runtime.exec(...) answer
starts Outlook Express from an application on the machine running the
code. They work in different environments, so you's rarely end up
choosing directly between them.

The OP first said that this was a server application (suggesting that
Runtime.exec(...) won't work unless the plan is to open OE on a server
somewhere); but then backtracked and suggested that Runtime.exec(...)
would work.

Of course, it's still a poor answer, for the reasons given. In the end,
the best answer will probably be to ask the user for the location of a
mail program.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Andrew Thompson

You can't really compare the two anyway.

Why sure I can, I just did. Whether the
comparison is valid is another matter.

And, yes, I think the comparison _is_ valid.

I was taking into account the (seemingly)
Win/IE/OE user base.

The vast majority will have that broken OS
component installed, which will all allow
OE to be popped open with a link. Those
same browsers may or may not have Java though.

[ I would _not_ have said that if the applet
was for general distribution to folks on
different platforms. ]
 
C

Chris Smith

Andrew said:
And, yes, I think the comparison _is_ valid.

I was taking into account the (seemingly)
Win/IE/OE user base.

Actually, I was misunderstanding something. You're assuming that
Runtime.exec is being executed in the applet. I was still stuck on the
OP's statement that this is a server application. Now you're making
sense.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Andrew Thompson

Actually, I was misunderstanding something. You're assuming that
Runtime.exec is being executed in the applet. I was still stuck on the
OP's statement that this is a server application. Now you're making
sense.

Aaah. Got it.

I think I still prefer
'the JavaMail solution' actually..

Simply because 'It's a Win/IE/OE user base'
becomes, '..until we bought out X company
to expand markets, now we run Win/Linux
...and a few legacy Macs'. ;-)
 
R

Roedy Green

Hey Im writeing a server app, and one option I was hopeing to include was
opening up outlook express, with the email address and a message included,
or even just call outlook express. I would really apreceate any idea's for
this

see http://mindprod.com/jgloss/exec.html

Look in the associations for your mail program to see what the command
line looks like. I doubt you will be able to pass the message on the
command line. You can't use the DDE hook in Java since that is MS
proprietary. If you wanted to go that route you would seen some JNI.
You might just send the message yourself with JavaMail.


see http://mindprod.com/jgloss/Javamail.html
http://mindprod.com/jgloss/jni.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top