ohctech_p8/send_email.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

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);
die(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);
?>