Treehouse: Grow your CSS skills. Land your dream job.

Email auto reply

  • # February 17, 2012 at 6:47 pm

    How would I code an auto reply to a form? In php and or javascript?

    # February 17, 2012 at 11:52 pm

    Once you have validated the form and stored the results you would call mail()

    Assuming your have already taken the users $_POST variable, validated it and stored it as $email further up the script then ….

    < ?php
    $to = $email;
    $subject = 'Form submission at';
    $message = 'This is an auto generated response from www.yoursite.comrnrnThank you for your submission.rn';
    $headers = 'From:' . "rn" .

    mail($to, $subject, $message, $headers);

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.