aspose file tools*
The moose likes Java in General and the fly likes Send Mail Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Send Mail Problem

Amit Suresh Pawar
Ranch Hand

Joined: Dec 09, 2008
Posts: 30
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?

Amit S. Pawar
SCJP,SCWCD,OCA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Send Mail Problem