*
The moose likes Other JSE/JEE APIs and the fly likes send email with web page textarea contents Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "send email with web page textarea contents" Watch "send email with web page textarea contents" New topic
Author

send email with web page textarea contents

darren schild
Ranch Hand

Joined: May 31, 2002
Posts: 32
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

Joined: Jul 13, 2001
Posts: 3150
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.


Spritle Software Blogs
darren schild
Ranch Hand

Joined: May 31, 2002
Posts: 32
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: May 31, 2002
Posts: 32
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: May 31, 2002
Posts: 32
Thanks Balaji, would you know how to do it with java? I know nothing of asp...
Thanks again!
Michael Lowden
Greenhorn

Joined: Jan 23, 2003
Posts: 5
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.


"Life is what happens when you've made other plans."<br />J.Lennon
Michael Lowden
Greenhorn

Joined: Jan 23, 2003
Posts: 5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: send email with web page textarea contents