I am having a textbox in my jsp and would like to send an e-mail to the receipent which his/her e-mail is entered in the textbox.
Can you please guide me on how to do that.
I have just checked out this code:
<html>
<head>
<title>mailto Example</title>
</head>
<body>
<form action="mailto:XXX@XXX.com" method="post" enctype="text/plain" >
FirstName:<input type="text" name="FirstName">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
You need to post your form to a servlet and from servlet execute this method to send mail.
your form should be
Here is code to send email from java,do proper mapping for servlet in web.xml
For servlet tutorials check it here