Jump to content

[SOLVED] using php script to send email from html form.


Scud

Recommended Posts

Hey guys, im new here. I was just wondering im using the script below so users of my website can submit their details and then once they click the submit button this script picks up the form details and then sends it to my email address, at the moment it is as follows and it works however i was wondering, when i receive an email. instead of receiving it from the email addy they submitted in the form, i receive it work [email protected] (the email i receive has my actual details in it, lol) i was hoping someone could help me out so when i receive an email instead of receiving it from that mydomains@myweb.... it receives the email from the address the user submitted in the form. how can this be done? thanks in advance!

 

<?
/* this part can either be in the same file as the form or it can be in a different file. If you want this in a different file, make the "action" of the form go to that file */

if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
$body .= "$key: $val \n";
}

mail("[email protected]", // to
"Mailing List - Menzclub.com.au",
$body);

}


// end form processing
?><style type="text/css">
<!--
body {
background-color: #000000;
background-image: url(http://www.menzclub.com.au/images/background.gif);
}
.style1 {
color: #FFFFFF;
font-family: "trebuchet MS";
}
.style3 {color: #FFFFFF; font-family: "trebuchet MS"; font-size: 9px; }
-->
</style>
<div align="center"><span class="style1">Thankyou. Your details and questions/comments have been sent and will be attended to shortly.</span>
  <br />
  <br />
  <br />
  <br />
  <br />
  <span class="style3">Redirecting in 5 seconds.</span></div>
<meta http-equiv='refresh' content='3;url=http://www.menzclub.com.au/home/'>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.