PHP表单/ HTML,每天向我发送空白邮件

时间:2018-12-12 13:40:34

标签: php forms email

我不知道为什么 任何建议都会有所帮助。我尝试了一切,这对我来说是不可能的

谢谢!!!!!

PHP代码

    <?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$formcontent=" Nombre: $name \n Telefono: $phone \n  Mensaje: $message";
$recipient = "mail@gmail.com";
$subject = "Senior Capital";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Gracias por Contactarnos!" . " -" . "<a href='index.html' style='text-decoration:none;color:#ff0099;'> Volver</a>";
?>

HTML代码

<form action="send_form_email.php" method="POST" class="probootstrap-form">
              <h2 class="text-black mt0">Contacto</h2>
              <div class="form-group">
                <input type="text" name="name" class="form-control" placeholder="Nombre" required>
              </div>
              <div class="form-group">
                <input type="email" class="form-control" placeholder="Email" name="email" required>
              </div>
              <div class="form-group">
                <input type="text" class="form-control" placeholder="Telefono" name="phone" required>
              </div>
              <div class="form-group">
                <textarea class="form-control" cols="30" rows="10" placeholder="Tu mensaje" name="message" required></textarea>
              </div>
              <div class="form-group">
                <input type="submit" class="btn btn-primary" value="Enviar">
              </div>
            </form>
          </div>

0 个答案:

没有答案