View Single Post
Join Date: Oct 2008
Posts: 84
Reputation: sfrider0 is an unknown quantity at this point 
Solved Threads: 0
sfrider0 sfrider0 is offline Offline
Junior Poster in Training

Re: get data from HTML form

 
0
  #3
Oct 23rd, 2008
This is my java code that I have when I hard coded the information
  1. SMTPSender s = new SMTPSender();
  2.  
  3. s.setToAddress("email@host.edu");
  4. s.setFromAddress("email@host.edu");
  5. s.setSubject("subject");
  6. s.setBody("this is the body");
  7.  
  8. s.sendMessage();
  9. }
  10. }
  11. class SMTPSender{
  12. String toAddress;
  13. public void setToAddress(String a){
  14. toAddress = a;
  15. }
  16. String fromAddress;
  17. public void setFromAddress(String b){
  18. fromAddress = b;
  19. }
  20. String subject;
  21. public void setSubject(String c){
  22. subject = c;
  23. }
  24. String body;
  25. public void setBody(String d){
  26. body = d;
  27. }
Here is my code for the form
  1. <h1>Mail Page</h1>
  2. Please type your mail stuff below:
  3. <form action=/mailer>
  4. To:
  5. <input name=toAddress ></input>
  6. </br>
  7. From:
  8. <input name=fromAddress ></input>
  9. </br>
  10. Subject:
  11. <input name=subject ></input>
  12. <br>
  13. Body:
  14. <input name=body ></input>
  15. <br>
  16. <input type=submit></input>
  17. </form>
How do I pass those?
Reply With Quote