0

Hello,

How can I send the form results to the person who fills it out. Currently, I am having it sent to me.

//The email address the message will be sent to
$youremail = "ttttt@ttttt.com";

<?

//Checks to see if the name field is empty. You can delete or add fields as needed.

 if ( (!empty($name)))
 {

  $name = stripslashes($name);
  $message = stripslashes($message);
//This is where the email is sent using your values from above.
  mail("$youremail", "$subject","$thetext");
?>
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Atli
0

Hi.

You could simply have him enter his email address and try sending it there.

Like:

<pre>
<?php
if(isset($_POST['email'])) {
  $usEmail = $_POST['email'];
  $usSubject = $_POST['subject'];
  $usMessage = $_POST['message'];

  if(mail($usEmail, $usSubject , $usMessage )){
    echo "Email sent!";
  }
  else {
    echo "Failed to send email!";
  }
}
?>
</pre>
<form action="?" method="post">
  Email: <input type="text" name="email" /><br />
  Subject: <input type="text" name="subject" /><br />
  Message: <textarea name="message"></textarea><br />
  <input type="submit" value="Send" />
</form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.