Click to See Complete Forum and Search --> : Simple (I think) HTML code needed!


derejrcar
03-23-2010, 10:11 PM
Hey guys,
I barely know anything about HTML. I know a few very simple things, but what I want to make is a little complicated. I want to make a code that will have a text box with a "send" button or something alike, that will send an email to the address I specify. Does this sound easy to make? Or even possible. I'd be putting into this for my toolbar:

<html>
<head>
<!--
Uncomment out the below script reference as needed. For more information on using the API, please consult http://www.conduit.com/Developers/overview.aspx
<script language="JavaScript" src="http://api.conduit.com/BrowserCompApi.js"></script>
-->
<style type= "text/css">
<!--
BODY {margin-left:0; margin-right:0; margin-top:0; margin-bottom:0;
width:100%;height:100%;overflow:hidden;background-color:threedface;}
-->
</style>
</head>
<body>

<!-- ENTER YOUR HTML HERE -->

</body>
</html>

So I want a way for someone to type something and have it sent to my email. Does anyone know how to do this? Thanks in advance.

mavigozler
03-24-2010, 12:45 AM
There are countless examples of what I believe you want to do found in a Google search. I used the search string "emailing form text (http://www.google.com/search?q=emailing+form+text+&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a)" in Google and found one result, this link (http://www.chami.com/tips/Internet/010597I.html), which I believe does what you want.

In general, you create a standard form element, containing a textarea element into which you take the user input, and in the action attribute of the form element, you specify a mailto: protocol with the address to which you want the input text to be emailed.

Now, the server that receives the form input (as an HTTP request, probably using the POST method) probably must be configured to process requests that specify actions using a different protocol other than an HTTP response. You would asking the server to process using a mailto: protocol (SMTP), and if you don't administer your server and it is not permitted to do such actions, you may need to get it authorized/configured to do that. That may involve paying (additional) money to upgrade your account if you buy hosting services, or reading through the server documentation to know how to configure it.

As for your HTML, it might look something like:


<form action="mailto:myusername@domain.com" method="post">

<textarea name="user-entry" rows="10" cols="50" onfocus="this.value='';">Enter your text here</textarea>

<button onclick="this.form.submit();">Send my comments</button>
<button onclick="this.form.reset();">Remove the nonsense comments I just entered</button>

</form>


Use CSS to style the form and its controls nicely, which is not shown here.