订阅表单不会向用户发送确认电子邮件

时间:2015-04-09 01:40:49

标签: php email

我正在尝试制作一个订阅表单,使用下面的脚本发送此确认电子邮件。

<?php 
    if($_POST) {

        // Enter the email where you want to receive notification

        $to = 'email@example.com';

       // DON'T EDIT BELOW CODE
        $subscriber_email = ($_POST['email']);

            // Send email code
            $headers = "From: ".$subscriber_email.;
            $subject = 'Hello, You Got A New Subscriber From "ENTER YOU SITES NAME"';
            $message = '<html><body>';
            $message .= '<img src="youurlogo.png" alt="company logo" />';
            $message .= '</head><body>';
            $message .= '<p> New Subscriber E-mail is:'< . $subscriber_email .'</p>';
            $message .= '</body></html>';
            $headers = "Reply E-mail: " . $subscriber_email;

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

                 echo "Hello world!"; 
        } 
      }
?>

以下是HTML表单:

<form action="forms/subscribe_us.php" method="post" id="subscribe-Form" novalidate>
                    <div class="row">
                       <div class="col-sm-8 col-md-8 col-lg-8 col-xs-12 sb-control-lg">
                          <div class="form-group">
                             <input type="text" class="form-control" id="email" name="email" placeholder="Your email address" />
                          </div>
                       </div>
                       <div class="col-sm-4 col-md-4 col-lg-4 col-xs-12">
                          <div class="form-group">
                             <button class="btn  btn-outlined btn-xl btn-white" type="submit" data-wow-delay="0.7s"><i class="fa fa-dot-circle-o"></i> Subscribe</button> 
                          </div>
                       </div>
                       <div id="response"></div>
                    </div>
                 </form>

0 个答案:

没有答案
相关问题