发送邮件php不在邮件正文中不显示字段

时间:2019-03-16 13:03:42

标签: email phpmailer

我正面临发送邮件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);
?>

0 个答案:

没有答案