• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

send email with web page textarea contents

 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would someone have sample code on how to send an email from a website.
What I would like to do is send the contents of a textarea to an email address using java mail. This would be performed on the client side.
I believe I have the javamail figured out but when I call it from the web page... I get nothing!
Also, can you do this without using a servlet?
I'll take all the help I can get! It would definitely save some hair...
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With out java code you can't use javamail..
the other option is to use javascript on the client side, but this option will not work with all users as many users don't necessary configure their browser with Outlook express or netscape or eudoraa. etc.,,
searching for the keyword "javascript email" will help you further.
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe I have the java code figured out (at least when I'm testing it directly it works). My problem is posting to that class, along with parameters (i.e. from, phone #, comments, etc) so the java code can send the email.
I am having to use IIS, for now. Any coding suggestions, sample code or maybe a URL having such?!?
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, are you using Jsp or servlets ??
if so I can give you some tips on how to do it!..
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java class written (straight java). Is that possible to do on the client side or would I have to use a servlet and/or jsp???

If I have to use a servlet/jsp is there a third party add-on for IIS? Or would I have to use something like Tomcat?
Thanks for the help!
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by darren schild:
I have a java class written (straight java). Is that possible to do on the client side or would I have to use a servlet and/or jsp???
If I have to use a servlet/jsp is there a third party add-on for IIS? Or would I have to use something like Tomcat?
Thanks for the help!

Depends!..
if you can Admin your IIS, then I would suggest you to install Tomcat http://jakarta.apache.org with IIS(for this download Tomcat and see its documentation on how to integrate tomcat with iis- its easy).
Since you are using IIS, if email is only thing that you have to do dynamically and if you are not at all going to use Java anywhere, then avoid tomcat and better sue ASP(active server pages)..
a simple code to send email is
html

asp:

HTH
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Balaji, would you know how to do it with java? I know nothing of asp...
Thanks again!
 
Michael Lowden
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do do it in java, email me here to find out. just make sure in the subject you put 'JAVARANCH', or i will forward to my spam archive (e.g. junk).
"mlowden _3000 @ hotmail .com"
remind me in the email what you want.
 
Michael Lowden
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually, reconsidered, just click here to DL the file. make sure you have mail.jar installed, and use the same html code as above, just link it to SendMail.jsp instead.
http://mjl.that-computer-guy.ca/___JUNK___/SendMail.htm
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic