• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Send Mail

 
Amit Suresh Pawar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I would like to create an email message in Java and place it in a users outbox to be sent when the email client connects to a mail server. Here is the code I am now using:

Runtime.getRuntime().exec("cmd /c start mailto:emailaddress@spam.com?subject=Test&body=Hello");

This creates a message window in Outlook and fills in the address and subject but does not send the message. I have to click on the send button to move the message to the Outlook outbox.

Is there a way to create an email message in Java and have a users default email client send it with out the user having to do anything?
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know that there are Java libraries that can interact with a user's email client to this degree, especially as it would be different for each email client. Some platform-specific and email-client-specific scripting may do the trick.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic