|
|
|
ต้องการให้ เมื่อส่งหา BOSS จะต้อง CC เมล์ให้ เลขา ด้วย ตอนนี้มันส่งหาได้แต่ Boss คนเดียว |
|
|
|
|
|
|
|
Code (PHP)
มันไม่ขึ้น CC ที่หัว E-mail ต้องการให้ เมื่อส่งหา BOSS จะต้อง CC เมล์ให้ เลขา ด้วย รบกวนช่วยดูหน่อยคะ
ตอนนี้มันส่งหาได้แต่ Boss คนเดียว
// Send Mail To boss
<select style="width: 500px;" class="tag-select" name='byboss' id='byboss'>
<?php
if(!$step)
{
echo "<option value=''>You Are Not Autherize</option>";
}
else
{
echo" <option value=''>Select Boss</option>";
foreach ($step as $key2)
{
$v = $key2['emp_id'];
$n = trim($key2['emp_code']);
$d = trim($key2['emp_name']);
$p = trim($key2['emp_pos']);
$l = tis2utf($key2['level_code']);
echo "<option value='$v'>$d</option>";
// echo "<option value='$v'>$l=$n($d)</option>";
}
}
?>
</select>
<?php
else if(chk_by == '' && app_by !='')
{
swal({
title: "Are you sure to Boss?",
text: "You will not be able to recover this",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, OK!",
closeOnConfirm: false
},function(){
swal({
title: "Sending Email Please Waitting ..",
text: "Just moment Please..",
timer: 20000,
showConfirmButton: false
});
//swal("Deleted!", "Your imaginary file has been deleted.", "success");
$.post("actionmail.php?op=sent_mail",params,function(data1){
//alert(data1);
if(data1=="success"){
swal("Check PR & Sent Email To Approver", "SUCCESS", "success");
setTimeout(function() {
window.location ='index.php?page=list_pr_chk';
}, 1500);
}else{
swal("Error Cannot Sent Email To Approve", "Please Type Again", "error");
}
});
});
}
//actionmail.php
function sent_mail()
{
$objConn = new SQLConnect();
$cost="select * From tm_emp where emp_id = '$byboss' ";
$row_cost = $objConn->select($cost);
//echo $cost;
foreach($row_cost as $rs)
{
$emp_email = $rs['emp_email'];
$emp_name = $rs['emp_name'];
$emp_pos = $rs['emp_pos'];
}
// CC Mail for Secretary
$q_Secretarys = "select * from tm_emp where emp_id in (446,687) and status = 'A' ";
$row_Secretarys = $objConn->select($q_Secretarys);
$emp_email_Secretarys = $row_Secretary['emp_email'];
//echo $emp_email_Secretary;
$head = "Send mail System to Boss ::";
$head .= "Cc: Ms.Secretarys Secretarys<".$emp_email_Secretarys.">"; -----> มันไม่ขึ้น CC ที่หัว E-mail
$detail = " <h3> Send Mail To Boss</h3>
</br>Dear $emp_name
</br>My Body & My Descriptio ";
send_mail($head,$detail,"",$emp_email,"","");
}
?>
Tag : PHP, Ms SQL Server 2016, Bootstrap Framework
|
|
|
|
|
|
Date :
2018-09-13 16:47:32 |
By :
nottpoo |
View :
667 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$to = "[email protected], [email protected]";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
mail($to,$subject,$message,$headers);
?>
credit : func_mail_mail
|
|
|
|
|
Date :
2018-09-13 17:00:05 |
By :
mongkon.k |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mail ( string $to , string $subject , string $message [, mixed $additional_headers [, string $additional_parameters ]] )
|
|
|
|
|
Date :
2018-09-13 17:05:21 |
By :
DK |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://php.net/manual/en/function.mail.php
|
|
|
|
|
Date :
2018-09-13 17:05:45 |
By :
DK |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปรับโค้ดใหม่ มันก็ยัง ไม่ CC เลขา
Code (PHP)
$objConn = new SQLConnect();
$q_pos="select * From tm_employee where emp_id = '$app_by' ";
$row_pos = $objConn->select($q_pos);
//echo $q_cost;
$emp_pos = $rs['emp_pos'];
if($emp_pos != 'MD'){
$q_cost="select * From tm_employee where emp_id = '$app_by' ";
$row_cost = $objConn->select($q_cost);
//echo $q_cost;
foreach($row_cost as $rs)
{
$emp_email = $rs['emp_email'];
$emp_name = $rs['emp_name'];
}
} else if ($emp_pos == 'MD'){
$q_cost="select * From tm_employee where emp_id = '$app_by' ";
$row_cost = $objConn->select($q_cost);
//echo $q_cost;
foreach($row_cost as $rs)
{
$emp_email = $rs['emp_email'];
$emp_name = $rs['emp_name'];
}
// CC Mail for Secretary
$q_Secretarys = "select * from tm_employee where emp_id in (446,687) and status = 'A' ";
$row_Secretarys = $objConn->select($q_Secretarys);
//$emp_email_Secretarys = $row_Secretary['emp_email'];
foreach($row_Secretarys as $Secretarys)
{
$emp_email_Secretarys = $rs['emp_email'];
$emp_name_Secretarys = $rs['emp_name'];
}
echo $emp_email_Secretary;
}
|
ประวัติการแก้ไข 2018-09-14 09:26:56
|
|
|
|
Date :
2018-09-14 09:24:57 |
By :
nottpoo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|