Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail server 1

Status
Not open for further replies.

yama

Programmer
Jun 28, 2001
69
SG
Hi,
I an currently doing a feedback form that have several textboxes for user to input their information, afterwhich when the user click submit, the form will be email to me mailbox, is there any way to do this in jsp?
thanks!
 
Check out this article on Sun's Java Developer Connection: Email Web Application Using JSP Tag Libraries ( Also check out this article published on JavaWorld a few years ago: Introduction to the Java Mail API (
You will have to find out if your Web Server is packaged with the JavaMail API, otherwise you will have to download and install it on your own.
Wushutwist
 
Hi,
do i need to download a mail server? if yes, which mail server do you recommend?
 
You need access to some kind of mail server. It doesn't have to reside on the same server as the Java Application but it needs to be accessible and support SMTP. For a free email implementation (follows GNU Public License) check out . It is really easy to use and would probably give you all the functionality that you want. Wushutwist
 
Hi,
i tried the servlets as you have recommend and everything works find except when i run the form and submit it, the following error comes out --> Error invalid host referrer.
how to solve the problem?
thanks!
 
Are you sure you have the smtp server's address and port correct? Post some code. I can't guaruntee you that I can help but I may see something that is out of place. Wushutwist
 
I am using Argo Mail server but i not really know how to configue the server, its there other mail server hat is easy to configure?
this is the mailproperties -->
#########################################
# CSMailForm Properties #
# Coolservlets.com #
# #
# You should edit this file to match #
# your desired settings. Items in the #
# required section must be changed. The #
# optional section can be left alone. #
#########################################

######################
## REQUIRED SECTION ##

# The name of your mailserver
# ie, youHost.com
smtpServer=gsim31001

# The port number your mail server listents to.
# This is usually 25
smtpPort=25

# This should the host name where the servlet
# is housed. ie, validHostName=

displayProperties=no

----------------------------------------
this is my form-->
<HTML>
<HEAD>
<TITLE>
test7
</TITLE>
</HEAD>
<BODY>
<form name=&quot;CSMailForm&quot; action=&quot;servlet/CSMailForm&quot; method=post>
<input name=&quot;toName&quot; type=&quot;hidden&quot; value=&quot;hi&quot;>
<input name=&quot;toEmail&quot; type=&quot;hidden&quot; value=&quot;testing@yahoo.com&quot;>
<input name=&quot;subject&quot; size=60 type=&quot;text&quot; value=&quot;The Subject&quot;>
<textarea rows=5 cols=50 name=&quot;message&quot; size=60 type=&quot;text&quot;>Your message goes here.</textarea>

<input type=&quot;submit&quot; value=&quot;Send Email&quot;>
</form>

</BODY>
</HTML>

--------------------
I followed the rest of the steps according to the coolservlet installation.
Thanks for your time!!
 
Can you send mail thru your mail server in the normal fashion (ie, Outlook, pine, whatever)? In most cases, it is the configuration of the mail server and not the java code, especially when you are using a package that was written and thoroughly tested previously. Wushutwist
 
oh...because i am working in an intranet environment, the mail server(outlook) has not been configure yet.
That is why I am trying to look into setting up a independent mail server in my pc.
 
Hi Wushutwist, i think i need you to explain to me what the term --> validHostName (in msg above) means. does it means the servlet directory of my webserver or anything else? because i cannot find any servlet directory in my project folder. i am using jbuilder 4 to build my application and i create a new project folder on my desktop. pls help =)
thanks!
 
What it wants is the path to prepend to the servlet name. On Tomcat it is but on other servers it could be different. For example in WebLogic you need to explicitly map each servlet, so it could be anything I want.

Actually, I originally wanted you send you this link: . It is an email package that you should be able to use from within your JSP pages. Somehow I gone mixed up and sent you a Servlet only solution. Sorry. You should check out the email package, good thing is that they have the Javadocs online. They should explain most of the settings. Wushutwist
 
Hi, i have follow ur link and dl the package need to email someone, i have set up and tested my mail server which is working fine, but when i tried to send mail using the package, an error occurs in my mail server --> Error: [10054] Connection reset by peer.
Is there any way to solve this problem? i have configue the SMTP host exactly as i have done for my outlook express.
Thanks again.
 
To test further switch on the SMTP logging to see the conversation between the webserver and the mailserver. The request for a connection may not even be getting to your Mail Server.

You say the Mail Server is running locally? Do you have the SMTP host in your code set to localhost or 127.0.0.1? Did you confirm that the Mail Server is running SMTP and that it is listening on port 25? Cannot you create a telnet session to port 127.0.0.1:25? Wushutwist
 
Oh, i finally done it, thx alot =)
I change my SMTP_HOST from my computer name to 127.0.0.1 and its working fine on my server, but i got a question, if i set the ip to 127.0.0.1, will other person using other PC be able to send the form/email to the server?
anyway, thanks again =)
 
Since JSP/Servlets are server-side technologies it doesn't matter where the client is located. If it works from your machine, it will work from halfway across the world. That is the power of server-side programming. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top