PHP邮件说未定义的变量?

时间:2018-04-12 00:11:23

标签: php email variables

PHP邮件说未定义的变量?

<?php 
if(isset($_POST['submit'])){
    $to = "ochrom@mail.com"; // this is your Email address
    $from = $_POST['email']; // this is the sender's Email address
    $first_name = $_POST['first_name'];
    $company_name = $_POST['company_name'];
    $phone = $_POST['phone'];
    $message = $S_POST['message'];
    $subject = "Form submission";
    $message = $company_name . " " . $first_name . " wrote the following:" . "\n\n" . $_POST['message'];
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
    // You can also use header('Location: thank_you.php'); to redirect to another page.
    }
?>
<!DOCTYPE html>
<head>
<title>Form submission</title>
</head>
  <body>

    <form action="" method="post">
            <h1>Brand Package</h1>
            <br>
First Name: <input type="text" name="first_name"><br>

Company Name: <input type="text" name="company_name"><br>

Phone Number: <input type="text" name="phone"><br>

Email: <input type="text" name="email"><br>

Message:<br><textarea rows="5" name="message" cols="50" style = "width: 100%"></textarea><br>

<input type="submit" name="submit" value="Order">
</form> 
</body>

0 个答案:

没有答案