• Post Reply Bookmark Topic Watch Topic
  • New Topic

opening default mail-client from java  RSS feed

 
vijay makam
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to open the default mail client(I can assume it to be OUTLOOK only, for simplicity sake) of the user from my java program with pre-populated subject and body. The user will then enter the TO list and may edit the body and then send it.

How to go about this requirement. I know we can use Java Mail to compose and send mails silently with out actually showing the mail client for editing and all.

Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
538
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
On a web page, you would use a mailto link. I haven't done Swing in a while, but a vaguely remember there being a way to create hyperLinks. So I would create a Swing hyperlink using the mailto protocol to accomplish this.
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vijay ,

you can use



command - exe which opens the outlook for instance

envp - arguments
 
vijay makam
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks All for your time to read the post and suggestions.
 
subhajit paul
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JDK 6, i would suggest you refer the Desktop API.

The java.awt.Desktop class has methods for invoking default programs for URLs and mailto: URLs and lot more.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And in the mailto URL you can put quite a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!