View Full Version : E-mail form Help


Zumoro
10-09-2006, 10:07 PM
Alright, i need some help making a code that would do the following

- create a dropdown box with various options
- create a text area
- save the value of the dropdown and text area and e-mail it to me.

and is there anyway to make an e-mail sender button that automaticall does it instead of opening the e-mail program with the message?

Ges
10-10-2006, 01:40 AM
Hello 'Zumoro', hope I can help. Are you after an emailer that allows your visitors to enter their name, email address, choose a subject from a drop down menu, and then enter some text in a text area. Then click a button like 'SEND' of which it then sends an email to you. If so, copy this HTML code as it is. Now, this FORM calls a PHP script in its ACTION part. I will gladly post you the script if you need.
The HTML code sets up the parameters to be passed to the php script. But first tell me if this is what you require. Just copy this lot as it is and try it but don't press the send button as it will go looking for the the PHP script and die!


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body>
<!-- PHP MAIL HANDLER IS THE PHP SCRIPT I WILL POST IF YOU NEED IT -->
<form action="PHP MAIL HANDLER.php" method="POST" class="theform">
<input type="hidden" name="required_fields" value="subject,name,email,message">
<input type="hidden" name="your_email_address" value="YOUR_EMAIL@your website.com">
<input type="hidden" name="check_email_address" value="yes">
<input type="hidden" name="background_color" value="#FFFFFF">
<input type="hidden" name="background_image" value="images/subground.png">
<input type="hidden" name="text_color" value="#000000">
<input type="hidden" name="link_color" value="#C000C0">
<input type="hidden" name="visited_link_color" value="#0000C0">
<input type="hidden" name="active_link_color" value="#0000C0">
<input type="hidden" name="highlight_color" value="#FF3333">
<!-- autoresponder setup -->
<input type="hidden" name="autoresponse" value="no">
<input type="hidden" name="owner_name" value="YOUR_EMAIL@your website.com">
<input type="hidden" name="response_subject" value="Thank you for your email">
<input type="hidden" name="response_mail" value="This is an auto response to let you know that your email has been successfully received and will be attended to shortly.Thank you!">
<input type="hidden" name="after_url" value="http://www.YOUR_WEBSITE.COM/thankyou.html">

<table border="0" width="600" align="center" cellspacing="15" bgcolor="#7B97E0">
<tr>
<td class="logoback" >
<table align="center" border="0" cellpadding="0" cellspacing="3">
<tr>
<td align="left">
<br>
<font size="3" color="#FFFFFF">
<b>Name:<font color="#FFFFFF"></font></b>
</font><br>
</td>
</tr>
<tr>
<td>
<input type="text" name="name" size="50">
<br><br>
</td>
</tr>
<tr>
<td align="left">
<font size="3" color="#FFFFFF">
<b>Email:<font color="#FFFFFF"></font></b>
</font>
</td>
</tr>
<tr>
<td>
<input type="text" name="email" size="50" >
<br><br>
</td>
</tr>
<tr>
<td>
<font size="3" color="#FFFFFF">
<b>Subject:<font color="#FFFFFF"></font></b>
</font>
</td>
</tr>
<tr>
<td>
<select name="subject" size="1">
<option select>This</option>
<option>That</option>
<option>Or even</option>
<option>The other</option>
<option>Hello</option>
<option>How are</option>
<option>You doing</option>
</select>
<br><br>
</td>
</tr>
<tr>
<td align="left">
<font size="3" color="#FFFFFF">
<b>Message:</b>
</font>
</td>
</tr>
<tr>
<td>
<textarea rows="10" cols="45" name="message">
</textarea>
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="Send Mail">
<input type="reset" value="Reset">
<br><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>


</body>
</html>



Hope this puts you on the right track Zumoro. Email systems are always best done using PHP scripting. If you want me to post my script that handles this form I will do so. I have written an autoresponder with it, ie when someone sends an email to you the script will automatically send a message back saying 'thank you for your email we will be in touch soon' or any message you like. Also, if the email is successfully sent then the form calls a 'thankyou.html'.
Just try this first without the PHP script and let me know.

Regards,
Ges.

Zumoro
10-10-2006, 11:29 AM
Thanks, and yes, i'd really like that php script. i just found it annoying how most of these HTML sites tell you how to e-mail stuff in textboxes but not in text fields.

so yeah, your right about what i need.

Ges
10-10-2006, 06:27 PM
Hi Zumoro, sorry for the delay in answering but unfortuanately I have to go to work sometimes ie, feed the the 5 thousands ( I have a young family ). Also the time difference does'nt help. I am in Leeds, England, Uk.
Anyway, the script requires exact changes to reflect your website URL and the email address that you use. Also, you can change the options for errors etc.
If you would like to see the script in action then you can use my site. I do not want to violate any advertising policies of this forum but I hope this will help.

http://www.flowersineden.co.uk/contact us.html

( yes, the space is required ).

You will also note that the script gives you the .IP. address of the sender and a few browser details.

The script is too long to put here as we are limited to the size etc. and has just denied me. Therefore, would you like it emailing to you?
Just let this old Limie know.
Regards,
Ges

Zumoro
10-10-2006, 10:09 PM
Sure! thanks for helping, and don't worry, i'll give credit on the page and in my credits section of my links page. (anything in paticular to put for you?).

dwollison@mdirect.net

Ges
10-11-2006, 04:31 AM
Hello 'Zumoro'. Great site. Hope all goes well. I am sending an email with 2 attachments;

1. The HTML file as posted here but reflecting your site.

2. The PHP script also reflecting your site.

Just place these in the root folder on your server or change the paths accordingley.

Note that in the HTML file I have set the autoresponder to 'YES'. This will send an acknowledgement to your client. Just set it to 'NO' if you use autoresponders in your site emails like I do. The HTML file will, upon success, redirect to a 'thank you.html' file. Just set the script to go to maybe your index.html instead.
I've posted this here for the benefit of other members (and moderators) should they need help also.

If you have any problems then please don't hesitate to contact me.

ges.scott@flowersineden.co.uk

Regards,
Ges.

PS More details in the email.

Zumoro
10-11-2006, 11:21 AM
oh thank you thank you thank you!

anyway, do you have a banner or something for me to put in the credits section of my links page?

Zumoro
10-11-2006, 12:30 PM
Um... it won't work, it says name not entered

i might just stick with a guestbook, but if you have any idea how to fix it, or a site you can direct me to that teaches php

Zumoro
10-12-2006, 12:41 AM
Nevermind, since i've now got the site on freewebs, i'm using their comments stuff, but i really, really appreciate you trying to help, the credits link offer is still on the table; just give me a banner to use and i'll slap it on my site!

meanwhile, unless you object, i'll keep the coding for the forms just in case i get it working.