我试图通过 mailer.php 页面在主题行中显示两个连接变量,但电子邮件中的主题行始终为空白。下面是相关代码。
/* Subject and To */
$to = 'nnorman@dimplexthermal.com';
$subject = $company . ' ' . $name;
/* Gathering Data Variables */
$name = $_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Company: $company <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $body, $headers);