我正在尝试完成一个简单的表单发送,但尽管现在看起来是发送电子邮件,但没有发送任何内容。。
$name = $_POST['name']; //Sender's name
$email = $_POST['email']; //Sender's email
$message_text = $_POST['message']; //Sender's message
$phone = $_POST['phone']; //Sender's phone no
$methodOfContact = $_POST['methodOfContact']; //Sender's methodOfContact
$group1 = $_POST['group1']; //Sender's an existing customer
$other = $_POST['other']; //filler
$AppointmentType = $_POST['AppointmentType']; //Sender's AppointmentType
$WhenSuits = $_POST['WhenSuits']; //Sender's WhenSuits
$message = $_POST['message']; //Sender's message
//Declare which field naems we're already using.
$currently_active = array( 'name',
'email',
'message',
'phone',
'methodOfContact',
'group1',
'AppointmentType',
'WhenSuits'
);
//Add fields added through theme options page to Email
$custom = '';
foreach ($currently_active as $key => $currently_active) {
if($currently_active['value']) {
$custom.= $currently_active['name'] . ": " . $currently_active['value'] ."<br /> 'n";
}
}
谢谢大家的帮助,我真的很感激!!!!!!!!!!!!!!!!!!
$user_fields
不是一个数组,因此当您将其与具有key=>值对的foreach一起使用时,它将不起作用。