Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get info sent to my email from Form Fields?

Status
Not open for further replies.
You can use the [blue] mailto:[/blue] function. Or some type of programming language to generate the email, with the input, and then send it.
Both of these alterntives have advantges and disadvantages,but without knowing more of your setup, and what languages are available to you for programming the email construction, there is not much more I can tell you.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Basically I use just Dreamweaver for designing layout and that it. Would it be possible to use a PHP form? Would that be what I need? Does the php form have to realte to the actual html page?
 
Using the mailto: option is a ba idea as stated here: but still is the simpler one.


Using the mail function from PHP is a good option if the host you re using supports PHP.
So. if you can use PHP, then you can use the mail() function from PHP. it basically takes in 4 parameters, From,To,Subject,body.

check this to see how the mail function works.

All you would need to do is change the the action parameter in your form to point to a php page that would send the email.

Code:
<form action="sendit.php" method="POST">
<input type=text name='person'>
<input type=text name='Subjec'>
<input type=text name='comment'>
<input type=submit value='SEND'>
</form>
in the sendit.php you would have something similar to this:

Code:
$to=email t which it is sent.
$from=$_POST['person'];  this references you forms field where the user input there name.
$subject=$_POST['subject'] also references a fiel in your form.
$body=$_POST['comment']; this si the textarea where the user wrote whatever he wants to send.


$response = mail($to, $subject, $coment, $from);

if($response[0]) echo "The message has been sent !<br />\n".$response[1];
else echo "The message can not been sent !<br />\n".$response[1];




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top