# HTML Email Form

**URL:** <https://forum.kirupa.com/t/html-email-form/277332>\
**Category:** web dev\
**Created:** [December 10, 2008, 9:42pm UTC](https://forum.kirupa.com/t/html-email-form/277332 "2008-12-10T21:42:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![njoay](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@njoay](https://forum.kirupa.com/u/njoay)\
**Post date:** [December 10, 2008, 9:42pm UTC](https://forum.kirupa.com/t/html-email-form/277332/1 "2008-12-10T21:42:55Z")

</div>

After searching and finding nothing I’ve decided to create a client-side form with simply javascript and html.

The script that I have in the \<head\> portion:

\<SCRIPT LANGUAGE=“JavaScript”\>  
\<!-- Begin  
function initMail(form) {  
text = "Check out this page: " + window.location;  
form.message.value = “Hi " + form.sendto.value + " (” + form.to.value + "):

"

- text + "

Your Friend,  
" + form.sendername.value + “(” + form.senderemail.value + “)”;  
return (form.to.value != “”);  
}  
// End --\>  
\</script\>

Then in the \<body\> I have:

\<form name=emailform method=post action=“mail.html” target="\_new" onSubmit=“return initMail(this);”\>  
\<input type=hidden name=subject value="\*\* Check Out This Site! \*\*"\>  
\<input type=hidden name=message value=""\>  
\<table\>  
\<tr\>\<td colspan=2 align=center\>Tell a friend about this page!\</td\>\</tr\>  
\<tr\>\<td\>Their Name:\</td\>\<td\>\<input type=text name=sendto\>\</td\>\</tr\>  
\<tr\>\<td\>Their Email:\</td\>\<td\>\<input type=text name=to\>\</td\>\</tr\>  
\<tr\>\<td\>Your Name:\</td\>\<td\>\<input type=text name=sendername\>\</td\>\</tr\>  
\<tr\>\<td\>Your Email:\</td\>\<td\>\<input type=text name=senderemail\>\</td\>\</tr\>  
\<tr\>\<td colspan=2 align=center\>\<input type=submit value=“Ok!”\>\</td\>\</tr\>  
\</table\>  
\</form\>

The part that I really need help on is the:  
\<form name=emailform method=post\*\* action=“mail.html”\*\* …

What is supposed to be in the mail.html file? I would also like a thank you page notifying the sender that the email has been sent. Any help would be greatly appreciated.

Thanks so much!
