]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include_once("include/config.php"); $sel_obj= new config(); $temp_session_id = session_id(); /*============== Post Your Question ===========*/ if(isset($_POST['send_mail'])) { // echo json_encode($_POST['product_ids'][0], true); // echo "<pre>"; print_r($_POST); die(); if ($_POST['recipient']=="all_users"){ $email_ids = NULL; }else{ $email_ids = json_encode($_POST['email_ids'][0]); } $insertdata = array( 'templete_id' => $_POST['templete_id'], 'email_ids' => $email_ids, 'product_ids' => json_encode($_POST['product_ids'][0]), 'subject' => $_POST['subject'], 'top_content' => $_POST['top_content'], 'middle_content' => $_POST['middle_content'], 'bottom_content' => $_POST['bottom_content'], 'user_type' => 'registered', 'created_at' => date("Y-m-d H:i:s") ); // print_r($insertdata); die(); /*------------------- Send email ----------*/ $where_temp = "id=" . $_POST['templete_id']; $temp_query = $sel_obj->display_rcd("mail_templete", $where_temp); foreach($temp_query as $templete) { } $mail_logo = $templete['logo']; $header_background = $templete['header_background']; $body_background = $templete['body_background']; $footer_background = $templete['footer_background']; $mail_subject = $_POST['subject']; $mail_top_content = $_POST['top_content']; $mail_middle_content = $_POST['middle_content']; $mail_bottom_content = $_POST['bottom_content']; $mail_footer = $templete['footer']; /*------------------------*/ ob_start(); if ($_POST['templete_id']==1) { include("mail_templete_1.php"); } if ($_POST['templete_id']==2) { include("mail_templete_2.php"); } if ($_POST['templete_id']==3) { include("mail_templete_3.php"); } $welcomeTemplate = ob_get_clean(); require '../php_mail/class.phpmailer.php'; if ($_POST['recipient']=="all_users") { $where_user = "`status`=1"; $user_query = $sel_obj->display_rcd("tblusers", $where_user); foreach ($user_query as $user_data) { /*----Email Send ----*/ $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'sales@a4paper.in'; $mail->Password = 'Stereo@1879'; $mail->SMTPSecure = 'tls'; $mail->From = "sales@a4paper.in"; $mail->FromName = "a4paper"; $mail->Mailer = "smtp"; // don't change the quotes! // $mail->AddAddress('rohan@vdcpaper.com'); $mail->AddAddress($user_data['UserEmail']); //Adds a "To" address // $mail->AddAddress('udit8prajapati@gmail.com'); //Adds a "To" address $mail->IsHTML(true); $mail->Subject = $_POST['subject']; $mail->Body = $welcomeTemplate; $mail->Send(); /*----------------------------------*/ } }else{ foreach ($_POST['email_ids'][0] as $email_id) { /*----Email Send ----*/ $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'sales@a4paper.in'; $mail->Password = 'Stereo@1879'; $mail->SMTPSecure = 'tls'; $mail->From = "sales@a4paper.in"; $mail->FromName = "a4paper"; $mail->Mailer = "smtp"; // don't change the quotes! // $mail->AddAddress('rohan@vdcpaper.com'); $mail->AddAddress($email_id); //Adds a "To" address // $mail->AddAddress('udit8prajapati@gmail.com'); //Adds a "To" address $mail->IsHTML(true); $mail->Subject = $_POST['subject']; $mail->Body = $welcomeTemplate; $mail->Send(); /*----------------------------------*/ } } $insert_query=$sel_obj->insert("emails",$insertdata); if ($insert_query) { echo 1; }else{ echo 0; } } ?>