Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call outlook express mail message window

 
srinivasa varadhan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i dont know if this question is for this section. but here goes the question.i want to call the email client outlook express mail message windows through java.what way can i call the message window . i have another query . i need to insert some email address stored in my database table in the mail message's "to" and "from" box.
Any help is appreciated
Srinivas
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srinivasa
I guess we need to use Runtime.exec() here. We can invoke "Outlook Express" via Start->Run option as,
msimn.exe and if we follow directions provided at,
http://www.okinfoweb.com/moe/mail/mail_029.htm
then it should work if we write,
Runtime.exec(new String[]{"msimn.exe","/mailurl:mailto:abc1@isp.com?subject=Stuff&CC=abc2@isp.com;abc3@isp.com&BCC=abc4@isp.com;abc5@isp.com&body=Text"});
See if this works for you.
Regards
Maulin
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maulin,
thanks for the code. its working fine. but i have another problem. i want to monitor the outlook express through java. for example if any email has come to my inbox in outlook express then a notification must be sent to my java client(mostly a java frame) and displayed as a message box.is this possible or am i asking too much. also are there any email api's in java to send and recieve emails.
Thanks for the help maulin.
Regards
Kiranmanohar
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do that without using native code. There is, however, the JavaMail API, which lets you fetch email directly from Java.
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest,
thanks for the suggestion.but i need to do it with outlook express. outlook express and my java client should be integrated. if for that i need to know native code, then i will follow that example. but i am new to native code. is there any code in nativejava to integrate outlook express with my java client program. as i told u before my java client has a button which on clicking pops the outlook express with all the addresses in the to,cc,bcc,subject and body sections.
on clicking the send button it goes to the email server which should be integrated with my java server program which has 2 parts a reciever program and a sender program. the reciever program should receive the email address found in the to section and check its validity. if the email address is valid then i have to store it to the database else i should not.
then if the email address is valid i have to send it to the sender java program which will in turn send it to the internet. "in short i need to send an outlook message through my java program to the internet". Any help is appreciated. also can u send me some examples for jni and javamail.
Regards
Kiranmanohar
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kiran
From the description you give here, it seems you are just popping Outlook express message window for composing a message. Rest everything you want to work via Java program. Am I right?
If I am correct in this assumption then I wonder "why" would one need to do that? Why not just popup a Java frame having those fields and let the user compose a message and then send it..??
Thanks!
Maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also, I wonder how come the questioner changed from "Srinivasa" to Kiran ?
OR I missed something here...
Regards
Maulin
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maulin
for the question why not popup a java frame, the requirement is basically from a outlook express.i have to stick with this. then the name change is bcoz srinivas and me are co-workers
ok can i use native api to solve the problem. if so any ideas of how to go about it as i am new both javamail and jni technology. any examples would be heartly welcomed.
Thanks
Kiranmanohar
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
another thing how to know the smtp address, username, password in my machine as of the smtp server running in my machine
Cheers
Kiranmanohar
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi maulin,
the code which u had given me to invoke the outlook express window is working fine except that when i give a whitespace between two words in the subject or message text then it fails to invoke the outlook express mail message window. instead it invokes the msimn.exe . In the link which u had given for invoking the outlook mail message window it was given that in case of a space in the subject text we have to give double quotes for the text to work. but i want it without double quotes . is there any solution for this. thanks once again .
[CODE}
Runtime.exec(new String[]{"msimn.exe","/mailurl:mailto:abc1@isp.com?subject=Stuff&CC=abc2@isp.com;abc3@isp.com&BCC=abc4@isp.com;abc5@isp.com&body=Text"});
[/CODE]
Regards
Kiranmanohar
 
kiran manohar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maulin,
i have solved the problem for the whitespaces between the subject and body by using the %20 and replacing all whitespaces with %20.
thanks for the interest u have shown
regards
Kiranmanohar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic