首页 > 解决方案 > 发送邮件 php 不在电子邮件正文中显示字段

问题描述

我面临问题发送邮件 PHP 问题我收到空白电子邮件正文电子邮件谁能帮助我做错了什么,如果有人解决我的问题,我真的很感激

我的表格代码:

	<form method="post" action="/mailsend.php">

                        

                                            	<input type="text" name="name" value=""  id="name" placeholder="Your Name" >

<input type="email" name="email" value="" id ="email" placeholder="Your Email ID*" required>

</div>
<input type="text" name="phone" value="" id="phone" placeholder="Your Phone No*" required>
<input type="submit" name="submit" value="Enquire Now" class="theme-btn btn-style-one">
</form>

我的发送邮件 PHP 代码是

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['phone'];
$from = 'From: yoursite.com'; 
$to = 'ansarul@webmatrixindia.com'; 
$subject = 'Customer Inquiry';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";

$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html\r\n";
$headers .= 'From: from@example.com' . "\r\n" .
'Reply-To: reply@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

标签: emailphpmailer

解决方案


推荐阅读