Yes.
You can use a server-side script (preferably) to send it, or you can use an action=mailto: form. However, be aware that this approach is somewhat unreliable, and the actual email received will be urlencoded. For example, if someone typed "My email is user@domain.com" in an input called message, it would appear to you as:
message=My+email+is+user%40domain%2ecom
This would be achieved like so:
Code:
<form action="mailto:webmaster@mysite.com">
<input type="text" name="message"/><br/>
<input type="text" name="name"/><br/>
<input type="text" name="email"/><br/>
<input type="submit"/>
</form>
So if someone was to fill in "Hello there," "John Smith," and "john@fsmail.net" respectively, you would (depending on browser) receive a message with an attachment called something like "attach.dat" containing:
Code:
message=Hello+there&name=John+Smith&email=john%40fsmail%2enet
This is very unreliable. In fact, don't do it. I just tested it in Firefox, and it didn't like it at all.
Try something in JavaScript - sorry, Mike, ECMAScript - like so:
Code:
<script type="text/javascript">
var to = "me@mydomain.com";
var re = "Message to the Webmaster";
function submitMailForm() {
var tform = document.mailform;
window.location = "mailto:" + to + "?Subject=" + escape(re) + "&body=" + escape(tform.message.value) + escape("\n\n") + escape(tform.name.value) + " (" + escape(tform.email.value) + ")";
}
</script>
<form name="mailform" onsubmit="submitMailForm();">
<input type="text" name="message"/><br/>
<input type="text" name="name"/><br/>
<input type="text" name="email"/><br/>
<input type="submit"/>
</form>
Bookmarks