Jump to content

PHP auto responder.


postonoh

Recommended Posts

Html code

<div id="feedback">
          <p class="error wrong_name"> Fill the correct name</p>
          <p class="error wrong_email"> Incorrect email</p>
          <p class="error wrong_message"> Enter your message</p>
        </div>
        <form action="sendemail.php" id="contact_us" method="post">
          <p class="label_name">Name</p>
          <p class="input_form">
            <input type="text" name="Name" width="20"/>
          </p>
          <p class="label_name">Email</p>
          <p class="input_form">
            <input type="text" name="Email" />
          </p>
          <p class="label_name">Message</p>
          <p class="input_form" id="textarea">
            <textarea name="Message" rows="5" cols="4" id="message_input"></textarea>
          </p>
          <p id="submit">
            <input type="submit" value="Send" name="submitButton" class="button" />
          </p>
        </form>
        <p id="success">Your message was sent succesfully!</p>

 

 

 

 

Php code

<?php
$mailTo = '[email protected]';
$name = htmlspecialchars($_POST['Name']);
$mailFrom = htmlspecialchars($_POST['Email']);
$subject = 'Information Request';
$message_text = htmlspecialchars($_POST['Message']);

$message =  'From: '.$name.'; Email: '.$mailFrom.' ; Message: '.$message_text;

mail($mailTo, $subject, $message);

?>

 

this works  real simple I would like to add a auto respond to the person click the submit button.

Link to comment
https://forums.phpfreaks.com/topic/234389-php-auto-responder/
Share on other sites

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.