44 lines
1.8 KiB
PHP
44 lines
1.8 KiB
PHP
![]() |
<?php
|
||
|
include('email_sender.php');
|
||
|
|
||
|
|
||
|
if ($_SERVER["REQUEST_METHOD"] == "POST" ) {
|
||
|
$to = $_POST["email_list_to"];
|
||
|
$cc = $_POST["email_list_cc"];
|
||
|
$subject=$_POST["subject"];
|
||
|
$message = trim($_POST["message"]);
|
||
|
$remarks = trim($_POST["remarks"]);
|
||
|
$modified_by=$_SESSION['RoleId'];
|
||
|
$ref_type=$_POST['ref_type'];
|
||
|
$ref_identifier=$_POST['ref_identifier'];
|
||
|
$isAttachment = $_POST['isAttachment'];
|
||
|
$filePath = $_POST['filePath'];
|
||
|
|
||
|
error_log("attachment" . $isAttachment);
|
||
|
error_log("filePath" . $filePath);
|
||
|
|
||
|
$query="insert into email_send_details set ref_identifier='".$ref_identifier."',ref_type='".$ref_type."',email_to='".$to."',email_cc='".$cc."',email_subject='".$subject."',email_message='".$message."',modified_by='".$modified_by."'";
|
||
|
|
||
|
error_log("email save query:".$query);
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
error_log("Failed to Save Email Details:".mysqli_error($conn)." Faling Query:".$query);
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
$from = getConfigKey('email_username');
|
||
|
$host= getConfigKey('email_host');
|
||
|
$user=getConfigKey('email_username');
|
||
|
$pass=getConfigKey('email_password');
|
||
|
$port=getConfigKey('email_port');
|
||
|
$auth=getConfigKey('SMTP_AUTH');
|
||
|
$SMTPSecure=getConfigKey('SMTPSecure');
|
||
|
error_log('sender '.getConfigKey('email_username'));
|
||
|
error_log('sender '.getConfigKey('email_password'));
|
||
|
error_log('sender '.$host);
|
||
|
error_log('sender '.getConfigKey('email_port'));
|
||
|
error_log('sender '.getConfigKey('SMTPSecure'));
|
||
|
send_mail($to, $cc, $subject,$message,$remarks,$from,$host,$auth,$user,$pass,$port,$SMTPSecure , $isAttachment , $filePath);
|
||
|
|
||
|
?>
|