我已经制作了这个php,它会将消息直接发送到我的收件箱。即使脚本在台式机和笔记本电脑上工作正常,我也无法在手机上使用。为什么会这样?难道我做错了什么? (我在iPhone 6+和三星Alpha上试过这个表格)
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "info@mydomain.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
header('Location: message-sent.html#contact'); exit();
?>
这是手机的HTML代码。
<form method="post" action="mail.php">
<div class="row 50%">
<div class="6u">
<input name="name" placeholder="Name" type="text" class="text" />
</div>
<div class="6u">
<input name="email" placeholder="Email" type="text" class="text" />
</div>
</div>
<div class="row 50%">
<div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row 50%">
<div class="12u">
<input type="submit" class="button alt" value="Send Message"/>
</div>
</div>
</form>
先谢谢大家的帮助。