• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java web and html forms

 
james santiago
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was wondering if it was possible to send an e-mail from a web page using java applet without having to use html forms.
nay ideas anyone!?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets are obsolete. Could you explain what you are trying to do in greater detail?
 
Paul Clapham
Sheriff
Posts: 21583
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can certainly send an e-mail from an applet, provided you get the security issues taken care of. (This is not a trivial matter and in practice you should look for another way to send those e-mails.) You do need HTML to cause the applet to run, but you don't need any <form> elements for that.

Was that what you meant by "html forms"? Were you asking about <form> elements, or something else?
 
james santiago
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was wanting to make an applet that calculates a price, this part is done, but i want all of the details from the calculator to be sent via email to a specific email address.
thats the plan, i got the applet working and it calculates just fine, but have no idea on how to get it to send all the details via email. i managed to get it to send an email but the email app wont pull the information from the applet textfields
 
Paul Clapham
Sheriff
Posts: 21583
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're wasting your time writing an applet, really, but if you want to learn how to send e-mail then you could use one. Just don't expect to actually implement one in real life, at least not easily.

So to send an e-mail with Java you'll need JavaMail. There's a jar file which you'll need in your classpath and there's some sample code you can start with at the JavaMail site (follow the links on that page I referred to).

EDIT: Your post referred to an "e-mail app" -- I don't know what that means, you didn't mention any details, but it's probably the wrong thing to do. By the way mentioning a problem without providing any details about that problem isn't a good way to get people to help you with it.
 
james santiago
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, so what would you recommend for this kind of program?
i am wanting to implement an application on a web page that calculates the price for a service, all of the information needs to then go back to the host so that they have some way of contacting the person that inputted the information
 
Paul Clapham
Sheriff
Posts: 21583
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
james santiago wrote:i am wanting to implement an application on a web page that calculates the price for a service, all of the information needs to then go back to the host so that they have some way of contacting the person that inputted the information


Yes, that's a much better idea than an applet. You have an HTML form where the client enters the relevant information, and then you send that information back to a servlet running on the host. The servlet will then do the calculations and send the e-mail. Or... you said you wanted to contact the person who input the information. That person is the one who just clicked the Submit button (no?) so you could just send the relevant information as the response to the form submission. That seems a lot more straightforward than sending an e-mail.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic