I need to make a web form that can automatically send a response e-mail.

Joined
Dec 20, 2006
Messages
772
My student group has a website and I have implemented a web form for memberships. Now, on my school server we only have access to html coding and no other server feature. We've moved to our own server and now with the added freedom I'd like to implement some new features with the web form.

First, I'd like to have a "Your Form Has Been Sent Page." That is, after a person hits the "Submit" button on the form, a new page loads saying it has been sent.
Second, I'd like to have an automatic e-mail sent to the person that filled the web form confirming they sent the e-mail and welcoming them to my student group.

Now, how do I do this and can it be done in all HTML?

Thanks for the help!
 
My student group has a website and I have implemented a web form for memberships. Now, on my school server we only have access to html coding and no other server feature. We've moved to our own server and now with the added freedom I'd like to implement some new features with the web form.

First, I'd like to have a "Your Form Has Been Sent Page." That is, after a person hits the "Submit" button on the form, a new page loads saying it has been sent.
Second, I'd like to have an automatic e-mail sent to the person that filled the web form confirming they sent the e-mail and welcoming them to my student group.

Now, how do I do this and can it be done in all HTML?

Thanks for the help!

AFAIK, this cannot be done in HTML. You need to use a scripting language. PHP's mail() function is the easiest:
http://email.about.com/cs/phpemailtips/qt/et031202.htm

To do this, your server must have PHP installed and configured.


ETA: Or use kittykatkarma's suggestion
 
Sorry, but there is no way you can send an email without any server-side interaction.

In fact, I'm not sure what would be the purpose of a membership web form without any server-side interaction... what the hell does the form do?
 
Okay, but how do I make it so that it sends the e-mail to the e-mail address the person inputs in the web form? The example looks like it'll only send a message to one specific e-mail address.

Note: I know almost nothing about PHP. If you tell me what a script does, I can figure out how to use it probably, but not what it's saying.
 
Sorry, but there is no way you can send an email without any server-side interaction.

In fact, I'm not sure what would be the purpose of a membership web form without any server-side interaction... what the hell does the form do?

The web form would just send an e-mail to me with their info (I then input the data into MS Access). I just want to be able to send a confirmation e-mail.
 
Now, how do I do this and can it be done in all HTML?

Thanks for the help!

Nope. It will require server side processing to save the form and do the other stuff. When a form is submitted all the data on the form is sent as a big string. You need software to process it. You'll need to use the cgi bin with a program written in Perl or something. I would use PHP myself which is different again.

What you use will partly depend on what services your web host has available. Only personal preference but if you are lucky your site will be hosted on a user friendly *nix system in which case it very likely has PHP and Perl available. Windows servers I know nothing about. :boggled:

It isn't something someone can show you n a thread. Google 'server side processing' and start learning. :)
 
I cannot be "all HTML". You will need something on the server-side to do it. (I am not aware of any client-side-only solutions to automatically sending an e-mail.)

If you happen to be using ASP.NET, there is lots of such functionality in System.Web.Mail.

A company I used to work for used Microsoft's Collaboration Data Objects (CDO) to do that, for a while. It comes with Microsoft Outlook, but I don't think it was an optimal solution, for some reason. The company eventually moved to some other 3rd party ActiveX library, but I don't remember what it was called, at the moment.
 
Okay, but how do I make it so that it sends the e-mail to the e-mail address the person inputs in the web form? The example looks like it'll only send a message to one specific e-mail address.

Note: I know almost nothing about PHP. If you tell me what a script does, I can figure out how to use it probably, but not what it's saying.

PHP automatically creates variables with the same name as your form fields. For example, if your email address field is named "email", PHP captures that field with the variable "$email".


The PHP mail function takes the form:
mail($toaddress, $subject, $mailcontent, $fromaddress);

You have to set the variables accordingly and then execute the mail() function...something like this:

<?
$subject = "Membership Notice";
$mailcontent = "Welcome to the student group";
$fromaddress = "youraddress@yourdomain.com";

mail($email, $subject, $mailcontent, $fromaddress);
?>

Your form processing script has to be saved with a ".php" file extension instead of ".html" or ".htm".
 
The crudest way to do is just emedding your entire form in to the "body" parameter along with instructions on filling out the form and entering their e-mail address in to the cc.

If you don't have the option of server side processing (typical if you don't own your own server) then you'd have to do some kind of scripting to get more sophisticated than that. Through javascript you have access to all the <a> tags via the "documents.link" collection. The code below illustrates that. You can modify them to whatever degree you understand javascript. But this restricts you to people who'll allow your script to run.

<body>
<a href="mailto:yourmail@domain.net;theirmail@domain.net?subject=example
&body=you'd put your form here">get form by clicking here.</a>
<script type="text/javascript">
for (i=0; i<=(document.links.length-1); i++){alert(document.links.href)}
</script>
</body>
 
The web form would just send an e-mail to me with their info (I then input the data into MS Access). I just want to be able to send a confirmation e-mail.

In that case the confirmation shouldn't be sent until you read the email and enter the data, since any number of things could go wrong up to that point.
 

Back
Top Bottom