PHP无法将复选框变量信息添加到电子邮件正文中

I am trying to create a simple service request form for a web site. The intent is for users to fill out the form, press the submit button, and generate an email which is sent to support.

Most of the form works properly, but I am not able to pass the values of checkboxes into the body of the email. When I add debug information (using echo), I can see that the checkbox variables are set, but the information is not passed to the email message--

Information received-- Checkboxes checked: Fix a broken link, Information on a web page needs to be updated, Information needs to be added to a web page

PHP code--

<?php

if (isset($_POST['email']))  {

$admin_email = "admin@somedomain.com";
$email = $_POST['email'];
$subject = $_POST['subject'];
$selectedChecklist = 'None';
$body = "Information received--

"; 
$comments = $_POST['comments'];

if(isset($_POST['check_list']) && is_array($_POST['check_list']) && count  ($_POST['check_list']) > 0){
$selectedChecklist = implode(', ', $_POST['check_list']);
$body .= 'Checkboxes checked: ' . $selectedChecklist;
echo($body);
}   


mail($admin_email, "$subject", $checklist, $body, $comments, "From:" . $email);


echo " Thank you for contacting us!";
}


else  {
?>

// HTML form goes here
<?php
}
?>

HTML code for form--

<form method="post">
Your Email: <input name="email" type="text" /><br /> 
<br />
Subject  :    <input name="subject" type="text" /><br /> 
<br /> 
What needs to be done?<br />
<input  name="check_list[]" type="checkbox" value="Fix a broken link">Fix a broken link<br /><br />
<input  name="check_list[]" type="checkbox" value="Information on a web page needs to be updated">Information on a web page needs to be updated<br /><br />
<input  name="check_list[]" type="checkbox" value="Information needs to be added to a web page">Information needs to be added to a web page<br /><br />
Description:<br />
<textarea name="comments" rows="15" cols="40"></textarea><br /> 
<br />
<input type="submit" value="Submit" /> 

You incorrect use function mail

Function accept only four arguments and you should use 3th parameter for message body.

In your example you can modify to next

$body .=  $comments;
mail($admin_email, $subject, $body, "From:" . $email);

P.S.: Variable $checklist is undefined in your code.