Click to See Complete Forum and Search --> : Need script to send form results by email


Tangles
12-03-2003, 04:13 AM
Hey there,

I'm using FrontPage as my HTML editor, and the stupid STUPID script they have for sending forms via email is STUPID... basically I have to install the Frontpage Server Extensions stuff on my host computer..... but my site is with GeoCities....

Do any of you have a script or something that I can use to send me form results via email, thats easier than MicroS@*! stuff??

Thanks,

Tangles

Gollum
12-03-2003, 06:07 AM
Easy Tangles, no need to get all knotted up :p.

One alternative to server-side mailing is using the mailto: protocol

You can set up a mail-message using the user's favourite e-mail program for the user to click the sent button.

essentially it looks something like this...

<a href="mailto:me@somewhere.com&CC=myfriend@somewhereelse.com&SUBJECT=Hi%20There&BODY=This%20is%20the%20message">Click here to send us a message</a>


Now you probably want to send your form data rather than a static message so you can do that in the onclick handler...

<script>
function buildMessage()
{
var s = new Array;
s.push("mailto:me@somewhere.com");
s.push("&CC=myfriend@somewhereelse.com");
s.push("&SUBJECT=Form%20Data");

s.push("&BODY=");
// All the text in the parameters need to be Internet safe
// so use encodeURI to encode all the unsafe chars.
s.push(encodeURI(getTheFormDataInAString()));

return s.join("");
}

<a onclick="this.href=buildMessage();">Click here to send this data in an e-mail</a>

ray326
12-03-2003, 01:04 PM
Try using this in your form tag:

<form action="mailto:you@yahoo.com" enctype="text/plain">