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 mydomains@mywebhosting.com.au (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("contact@menzclub.com.au", // 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/'>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.