How do I set up a text box that will send info to my email?

Perseus

Registered
Since action:mailto is old and tacky, and since I don't know much about scripting, can anyone provide me with a tutorial or URL to ONE THAT WORKS? :D I just need people to enter some text, hit submit, and have that info send to my email address. Thanks!!
 
I find that PHP or CGI scripts are the best solution. I've had good luck with this script:
http://www.scriptarchive.com/formmail.html

However, you can do it using GET instead of POST on the submit button and passing variables like this:

Code:
a href="mailto:whoever@whereever.com?subject=Typemysubjecthere?&body=Body of email document">Send email</a>

The downside is that the body of the message is limited to 255 characters.
 
I downloaded that script and began reading the READ ME, and it would have best been written in Gibberish. I have absolutely no idea what this guy is talking about. It seems like he is talking about which email addresses to allow, I am looking for text entered on a website to be sent to ME. I dont care who can type stuff in there, just get the friggin text to me!
 
Yeah you need to have a server that support CGI scripts for it to work. I had to do something similar for a church website. Mind you, I'm no coder but I can understand the flow of the code. I used to Google to perform my research regarding email forms on websites. They exist, but again the server hosting the site has so support CGI scripts and perl or another scripting language (depending on what the code in the script is).
 
If you have PHP setup on your server, it takes one line of code to process the form and send the email (more if you want validation). PM/post/email me and I can help you with the code.
 
Simbalala, that seems like a good one, however I don't understand how to integrate it into an allready existing page. The working example is on a seperate page on its own, I need it to be on a page I have allready made code for. Can I reference/call it like a css file? Or do I just copy and paste all of this code into my page?
 
Looks to me like you can have your normal HTML file, and it needs to point to the php document to send.
 
Veljo said:
Looks to me like you can have your normal HTML file, and it needs to point to the php document to send.

That's the way I've used it. Very convenient, just a link and the contact page appears.

I did have to add stripslashes to it because my servers have magic quotes turned on

Code:
// send mail and print success message
$message = stripslashes($message);
$Name = stripslashes($Name);
mail($recipientemail,"$subject","$message","From: $Name <$Email>");

You may or may not need to do this depending on your server.

You'll know if the emails you get look like this:

The quick brown fox jumped over the dog\'s back.

You could add the code to your regular html page, just play around with it. It's pretty easy to understand. If you're new at this the easiest thing might be to customize the new contact page until it looks like your original html page then swap them.
 
Back
Top