PDA

View Full Version : email form



mavrick422
12-18-2005, 08:22 PM
hi, i am trying to make a page on which there is text field that says "type your email address" and another saying "type your message". i want a "submit" button on the bottom of the page to send the message from the "type your message" box to the email address in the "type your email address" box. i need this to be done without opening an email service with the "to" and "content" sections filled out. i need the java or whatever to do it all itself. like, i would have the javascript send the message entered to the email address entered from my email address that is somehow built into the javascript. is that possible?

Twey
12-18-2005, 10:02 PM
Ah... you can, unreliably. However, it's a far better idea to use a free mail-processing service like Mail Maniac (http://www.mail-maniac.com/).

mavrick422
12-18-2005, 10:50 PM
could you explain this unreliable way to do it, just so i can see how unreliable it is for myself? also, the mailmaniac service emails the info entered to the webmaster, not the user. i need the infor entered to be emailed to the user. thanks

Twey
12-19-2005, 11:57 AM
It can be mailed to whomever you choose. If you look in the code it generates, you'll see:

<input type="hidden" name="mailto" value="your(at)emailaddress.com">If you change this to:
<input type="text" name="mailto" onkeyup="this.value = this.value.replace(/@/g, '(at)');">it will show a textbox in which the user can type the email address to send to.

The unreliable way is:
<form method="post" action="mailto:user@domain.tld">which will send the data (if the user is using a compatible browser, and doesn't have a firewall that will stop this, and has an email client that will let this through) in an ugly and just-barely-readable format (e.g. "Check out http://www.google.com!" would become "Check+out+http%58%2f%2fwww%2egoogle%2ecom%33" in an attachment to an email, the name of which would vary depending on the browser used).