One of the best features of JSP is the ability to break the project into components. This messaging tool also has these features, and our components include:
An HTML form that is used to post an email message to a JSP.
A JSP page that is used to process and send the mail.
The first step is to create a form that uses HTML that can be sent to a JSP page. You can copy the HTML source code from list A to your machine.
<HTML>
<BODY> <form action= "sendmail.jsp" method= "POST" >
<table align= "center" >
<TR>
<TD width= "50%" >
To:<br><input name= "to" size= ">"
</TD>
<TD width= "50%" >
From:<br><input name= "from" size= ">"
</TD>
</TR>
<TR>
<TD colspan= "2" >
Subject:<br><input name= "Subject" size= "M" >
</TD>
</TR>
<TR>
<TD colspan= "2" >
<p>message:<br><textarea name= "text" rows=25 cols=85></textarea></p>
</TD>
</TR>
</TABLE>
<input type= "Submit" Name= "Cb_submit" value= "Send" >
<input type= "reset" name= "Cb_reset" value= "clear" >
</FORM>
</BODY>
</HTML>
The HTML form creates a document that collects basic email information such as to, from, Subject, and message. Of course, the benefit of creating your own mailing form is that you can control the information you collect, more or less you can decide. Take a look at the HTML form samples generated here.
The HTML document has two main requirements: first, the action of the form must be: Post to the tool described below sendmail.jsp, but in your application, you can replace sendmail.jsp with the appropriate URL. Again, you need to specify the fields that you want to include so that users can send this information. The next section of this lesson will introduce some of the features of JavaMail in order to overcome the obstacles to mastering the third part. So now let's take a look at JavaMail.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.