Print Page | Close Window

Needs Help With Emailing Results Using PHP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26393
Printed Date: 29 March 2026 at 4:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Needs Help With Emailing Results Using PHP
Posted By: Misty
Subject: Needs Help With Emailing Results Using PHP
Date Posted: 09 October 2008 at 9:03pm

I love to use ASP. But I cannot use ASP on one of my clients' web hosting plans because it doesn't support ASP so I have to use PHP. I don't know that much PHP. :( I am sure that there are some people on this forum that know PHP.

Please look at http://www.stellohomeservices.com/contact.htm - http://www.stellohomeservices.com/contact.htm . This form is supposed to post to a PHP file. I got a simple PHP file, but it doesn't submit all of the results.

Here's the simple PHP File I have so far:

<?php
$to = " mailto:misty@you.com - misty@you.com ";
$subject = "Test Email From PHP Contact Me Form";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>

I would like for all of the fields such as the check boxes to be included in the results. I would like for there to be a <br> tag between each field. I also would like for the email that is sent to show the person's name and the email address as from on the email.




Replies:
Posted By: iSec
Date Posted: 12 October 2008 at 1:57am
Like this?
 
<?php
$to = mailto:misty@you.com - misty@you.com ;
$subject = "The Test Email From PHP Contact Me Form";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your email message below was sent successfully"; }
else
{print "Sorry, We encountered an error sending your mail below. Please hit the back button on your browser and try again!"; }?>
<br />
<p>
<b>Name</b>: <?php echo $_POST["txtName"]; ?>.<br />
<b>Address</b>: <?php echo $_POST["txtAddress"]; ?>
<b>City</b>: <?php echo $_POST["txtCity"]; ?>.<br />
<b>State</b>: <?php echo $_POST["SelState"]; ?>.<br />
<b>Zip</b>: <?php echo $_POST["txtZip"]; ?>.<br />
<b>Phone</b>: <?php echo $_POST["txtPhone"]; ?>.<br />
<b>Email Address</b>: <?php echo $_POST["txtEmail"]; ?>.<br />
<b>Type of Project</b>: <?php echo $_POST["chkbox[]"]; ?>.<br />
<b>Details on Project</b>: <?php echo $_POST["txtaProjectType"]; ?>.<br />


-------------
"When it gets dark enough, you can see the stars"
-Charles A. Beard



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net