Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I send email from an JSP page with HTML format either using jsp

843835Mar 28 2002 — edited Apr 1 2002
hi,
I have an jsp page with online application form,after compleating the form if i select submit it will send all the compleated data to the mail id we mentioned in the form tag,for this i am using javascript,but instead of receiving the data in the format of strings,my client want to receive the data in the same format as he's filling in the jsp page(html format) through e-mail.any help would be appreciated.the fallowing is the code right now i am using for email application.
<code>
function send()
{
if(validatePersonalInfo(document.theform))
{
document.theform.submit()
location.href=location.reload()
}
}
function validatePersonalInfo(form)
{
var tmpStr ="";

if (form.Name.value == "") {
tmpStr = "Name";
document.all.dName.style.visibility="visible";
document.theform.Name.focus();
}
else{
document.all.dName.style.visibility="hidden";
}
if (form.SSN.value == "") {
tmpStr = tmpStr + ", Social Security Number";
document.all.dSSN.style.visibility="visible";
if(form.Name.value != "")
{document.theform.SSN.focus();}
}
else{
document.all.dSSN.style.visibility="hidden";
}
if (tmpStr == "") {
return true;
} else {
alert("Please Fill the Following Fields: " + tmpStr);
return false;
}

}
<FORM NAME="theform" METHOD="post"
ACTION="mailto:abcd@abcde.com?subject=Online Application Form for MinorityDealer." ENCTYPE="text/plain">

<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="10" NOF="LY">
<TH>
<P>
<FONT SIZE="3" FACE="Arial,Helvetica,Univers,Zurich BT">Online�Application</font></TH><BR>
</TABLE>
<table width="718" border="1" cellspacing="0" cellpadding="3" bgcolor="#CCCCFF" align="center">
<tr>
<td colspan="2"><font class="captionText">Name*�</font><br><input type="text" size="25" name="Name" class="bodyText">
<div id="dName" name="dName" style="position:absolute;visibility:hidden"><font color="red">Name is Mandatory*</font></div>
</td>
<td colspan="2"><font class="captionText">Social Security Number*�</font><br><input type="text" size="9" name="SSN" class="bodyText">
<div id="dSSN" name="dSSN" style="position:absolute;visibility:hidden"><font color="red">SSN is Mandatory*</font></div></td>
</tr>
<tr>
<td colspan="2"><font class="captionText">Total Personal Assets</font><br><input type="text" size="10" name="TotPersAss3" class="bodyText"></td>
<td colspan="2"><font class="captionText">Total Personal Liabilities & NetWorth</font><br><input type="text" size="10" name="TotPerLiab3" class="bodyText"></td>
</tr>
</tr>
</TABLE>
<IMG Valign="middle" name="imgSubmit" src="images/buttons/Submit.gif" width="66" height="29" border="0" alt="Submit">

</code>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2002
Added on Mar 28 2002
3 comments
188 views