File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Send Mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Send Mail " Watch "Send Mail " New topic
Author

Send Mail

Amit Suresh Pawar
Ranch Hand

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

Amit S. Pawar
SCJP,SCWCD,OCA
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8705
    
    6

JavaMail API


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Send Mail
 
Similar Threads
Saving mail from outlook with attachment with Java
Read receipt
how to call outlook express mail message window
Send Mail Problem
to call outlook express mail message window