Archived

This topic is now archived and is closed to further replies.

AndyTang

[java] Java mailto implementation

Recommended Posts

Does anyone know if Java supports a easy class or functions to do a ''mailto'' ability as in forms - basically I dont want a mail application to start up, just sends (submits) some text to a email address.

Share this post


Link to post
Share on other sites
Is there a simpler method? Say something that uses the browsers own submit mail to implementation? This is because all I want to do is create an applet that retrieves some info from the user (encrptys it, thats why an applet and not a form) and send it via email.

Share this post


Link to post
Share on other sites
You could possibly use some Java to javascript integration technology to solve that problem. I have done similar things long ago with Netscape''s LiveConnect, but that may be outdated.

Another way would be to have the applet open a HTTP connection to the webserver and post the encrypted data in the same way as you would post a form to a server-side script that handles the actual mailing. In other words, you write some code that simulates the GET or POST method that the browser uses to post form data and you install some kind of formmailer script on your homepage (make sure to secure the script so it can not easily be used to send spam though). This may be the simplest solution since simulating a GET query just require that you send a few lines of text over the HTTP connection''s output stream.

Share this post


Link to post
Share on other sites