You could use something like this:
This is the form they would use to send them an email:
HTML Code:
<form method=post action="thanks.php">
<table width="629" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="136" height="27" align="right"> <div align="right" class="style5"><font size="2">Your
Name:</font></div></td>
<td width="493"> <p>
<input type="text" name="name">
</p></td>
</tr>
<tr valign="top">
<td width="136" height="27" align="right"> <div align="right" class="style5"><font size="2">Your
E-mail:</font></div></td>
<td width="493"> <p>
<input type="text" name="ThereEmail">
</p></tr>
<tr valign="top">
<td height="27" align="right"><span class="style5"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Subject:</font></span></td>
<td><p>
<input type="text" name="thesubject">
</p></td>
</tr>
<tr valign="top">
<td width="136" height="107" align="right"> <div align="right" class="style5"><font size="2">Your
Message:</font></div></td>
<td width="493"> <div align="left">
<textarea name="message" cols="50" rows="4"></textarea>
</div></td>
</tr>
<tr>
<td colspan="2"> <div align="center">
<input type="submit" name="Submit" value="Send">
<input type="reset" name="Clear" value="Clear">
</div></td>
</tr>
</table>
</form>
The form would be submitted to thanks.php which would look something like this:
PHP Code:
<?php { $email = "Sender Name:\t$name\nSender E- Mail:\t$ThereEmail\nSubject:\t$thesubject\nMessage:\t$message\nIP:\t$REMOTE_ADDR\n\n"; $to = "YourEmailAddress@YourDomain.com.au"; $subject = "$thesubject \n"; $mailheaders = "From: $thereemail \n"; $mailheaders .= "Reply-To: $thereemail\n\n"; mail($to, $subject, $email, $mailheaders); include("thanks.html"); } ?>
From here they will be redirected to thanks.html or you have them be redirected to where ever you want them to go.
As far as sending them back a response saying that you received the message, you can setup an autoreply on your email account saying that. Or you can BCC, them a copy of the email you receive... Just a thought.
And on the form page you can do something like to show their IP address:
HTML Code:
<p>Your IP address is <?php echo($REMOTE_ADDR); ?>. I have this logged.</p>
Hope this helps.
|