검색을 통해 완료된 목록이 있습니다. 선택한 사람에게 전자 메일을 보내려고합니다. 코딩 및 기능을 수행했지만 여전히 작동하지 않습니다. 제발 도와주세요.PHP : 체크 박스에 이메일을 보내십시오.
FORM :
<td align="left"><?php echo ucwords(stripslashes($row_list['nama'])); ?>
<td align="center"><input type="checkbox" name="txt_email_list" value="<?php echo $row_list['email']; ?>" /></td>
<td width="300" align="left">Send <a href="send_surat.php"><img src="images/email.png" width="24" height="24" border="0" align="absbottom"></td>
SEND 기능
$subject = 'Detail about u';
// message
$message = '
<html>
<head>
<title>Maklumat Majikan dan Tarikh Temuduga</title>
</head>
<body>
//message
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From: JobsMalaysia Centre <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers .= 'Bcc: [email protected]' . "\r\n";
if(isset($_POST['total_email']) && is_array($_POST['total_email'])){
foreach($_POST['total_email'] as $to){
mail($to, $subject, $message, $headers);
}
}
else{
echo "No email addresses to send to!";
}
편집 :
<form action="send_surat.php" method="post" name="send_surat" class="search_form">
<td align="left"><?php echo ucwords(stripslashes($row_list['nama'])); ?></td>
<td align="center"><input type="checkbox" name="email"/>
<input type="hidden" name="total_email" id="total_email" value="<?php echo $row_list['email']; ?>"/></td>
<td><input type="submit" name="btn_email" id="btn_email" value="Send Email"/></td>
"It does not workout"은 극히 도움이되지 않습니다. 세부 정보를 추가하십시오. – Blorgbeard
PHP 페이지에 연결 중입니다. 양식을 제출해야합니다. – Cfreak
입력을 양식 태그로 묶어야합니다. 또한 앵커 태그가있는 양식 변수는 전달할 수 없습니다. 대신 input type = "submit"을 사용하고 send_surat.php에 대한 조치를 취하십시오. – dukedevil294