2006-09-04, 09:15 AM
Hi, i have a php script that submits a form via e-mail. the script appears on the thank you page.
here is the script:
the fields on the form page, that will be sent are: your_name - senders nane
your e-mail - senders e-mail
send_to_name - recieve name
send_to_email - recieve e-mail
My question is, how do i change the script so $mailto = send_to_email, if i know that then i can work out the rest. also where do i include a message to go in the e-mail? is it $ mailbody? and if so how do i include html in it?
ty and rep to all that helps!
here is the script:
<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "e-mail";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
the fields on the form page, that will be sent are: your_name - senders nane
your e-mail - senders e-mail
send_to_name - recieve name
send_to_email - recieve e-mail
My question is, how do i change the script so $mailto = send_to_email, if i know that then i can work out the rest. also where do i include a message to go in the e-mail? is it $ mailbody? and if so how do i include html in it?
ty and rep to all that helps!