ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشسdggרות הל555ה התafhgfh
במסgרות ה gh//شی הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותהתנדaghhhhו12ין יעל, המעציfghfghfע
/
www-data
/
newsites
/
application
/
controllers
/
Upload FileeE
HOME
<?php defined('BASEPATH') OR exit('No direct script access allowed'); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; class Sendemail extends CI_Controller { function __construct() { parent::__construct(); } public function index() { $tomailid=$this->input->post('branch_email'); $cc=''; $subject="Enquiry"; $message= $this->input->post('message')."</br>Branch URL: ". $this->input->post('hostname')."</br>Email:".$this->input->post('email')."</br>Phone:".$this->input->post('phone'); if($this->input->post('phone') !="" && $this->input->post('email') !=""){ $this->load->model('Welcome_Model'); $this->Welcome_Model->add_enquirydata($this->input->post('email'),$this->input->post('phone'),$message,$tomailid,$this->input->post('hostname')); $mail=$this->mail_scheduler($tomailid,$subject,$message,$cc); }else{ echo json_encode("error"); } } public function mail_scheduler($to,$subject,$message,$cc) { require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; $mail=""; $mail = new PHPMailer(true); $mail->IsSMTP(); try { $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.office365.com"; // sets the SMTP server $mail->SMTPSecure = "tls"; $mail->Port = 587; // set the SMTP port for the MAIL server $mail->Username = "noreply@varsitymgmt.com"; // SMTP account username $mail->Password = 'Scts@456'; // SMTP account password 19-07-2017 if($to!="") { $toarray=explode(",",$to); foreach($toarray as $key => $val) { $mail->AddAddress($val); } } if($cc!="") { $ccarray=explode(",",$cc); foreach($ccarray as $key1 => $val1) { $mail->AddCC($val1); } } $mail->SetFrom('noreply@varsitymgmt.com', 'Website Enquiry Email'); $mail->Subject =$subject; $mail->MsgHTML($message); $mail->Send(); echo json_encode("success"); } catch (phpmailerException $e) { echo json_encode("error"); } catch (Exception $e) { echo json_encode("error"); } } }