Results 1 to 2 of 2

Thread: php auto response help!

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default php auto response help!

    can someone help me come up with a code that would generate auto response when the person submits the form and gets a thank you message.

    Here are my php code


    <?php
    // Change the 2 variables below
    $yourEmail = 'kalok626@hotmail.com'; //Your email address. mails will go here
    $yourSubject = 'testing'; //mail subject
    $from = $_GET['email'];

    if(!empty($_COOKIE['feedback'])) die('<p style="color:red;">You can\'t send another feedback within 30 seconds</p>');

    if(!empty($_GET['feedback'])){
    if(empty($_GET['name']) || empty($_GET['email']) || empty($_GET['subject']) || empty($_GET['comment'])) die("Please fill fields");

    $msg ="Name: ".$_GET['name']."<br/><br/>";
    $msg.="Subject: ".$_GET['subject']."<br/><br/>";
    $msg.="Message: ".$_GET['comment'];


    //set mail headers
    $headers="Mime-Version:1.0\r\n";
    $headers.="Content-type:text/html; charset=utf-8\r\n";

    /* additional headers */
    $headers .= "From: ".$_GET['email']."\r\n";
    $headers .="Subject: $yourSubject \r\n";

    if (mail($yourEmail,$yourSubject,$msg,$headers)) {
    setcookie("feedback","sent",time()+30);
    echo '<span style="color:green;font-weight:bold;">Thank You, we will get back to you within 24 hours!</span>';
    } else {
    echo '<p style="color:red;">Failure! There are some while sending email. Please send mail to '.$yourEmail.'</p>';
    }
    }

    ?>

  2. #2
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If someone can give me an answer to this I would really appreciate.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •