我有简单的sendmail表格。我收到电子邮件,但没有名字没有消息也没有主题。问题更严重我无法接收电子邮件,但在我添加行<body>
<div class="container_dc" onclick="window.open(window.clickTag)">
<img id="cta_dc">
<img class="logo_dc"/>
</div>
</body>
之后我才开始接收电子邮件,但未知发件人没有主题且没有消息
这是sendemail.php
$headers = implode("\r\n", $headers);
这是表单的HTML代码。也许这里有问题。
<?php
$name = $_POST['name'];
$from = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = 'tradertarik@gmail.com';
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "From: {$name} <{$from}>";
$headers[] = "Reply-To: <{$from}>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
$headers = implode("\r\n", $headers);
mail($to, $subject, $message, $headers);
die;