我无法从联系表单页面发送邮件。这是我的代码,有人可以帮我解决这个问题吗?
<div id="wrap">
<div id="form_wrap">
<form>
<label for="name">Name: </label>
<input type="text" name="name" value="" id="name" />
<label for="email">Email: </label>
<input type="text" name="email" value="" id="email" />
<label for="email">Your Message : </label>
<textarea name="message" value="Your Message" id="message" ></textarea>
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary" placeholder="support@arterydigital.com">
</div>
</form>
</div>
</div>
答案 0 :(得分:1)
你的意思是这样的。简单的概念之一:
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
if (isset($_POST['submit'])){
$to = 'support@arterydigital.com';
$subject = 'New Info';
$headers = "From: ".$name."."-".".$email."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//send it now ...
mail($to, $subject, $message, $headers);
echo "Successfully sent";
?>