Server IP : 192.185.129.71 / Your IP : 18.188.66.142 Web Server : Apache System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : svymadmin ( 4072) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/school/application/models/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Email_model extends CI_Model { function __construct() { parent::__construct(); } function account_opening_email($account_type = '' , $email = '', $password = '') { $system_name = $this->db->get_where('settings' , array('type' => 'system_name'))->row()->description; $email_msg = "Welcome to ".$system_name."<br />"; $email_msg .= "Your account type : ".$account_type."<br />"; $email_msg .= "Your login password : ". $password ."<br />"; $email_msg .= "Login Here : ".base_url()."<br />"; $email_sub = "Account opening email"; $email_to = $email; $this->do_email($email_msg , $email_sub , $email_to); } function password_reset_email($new_password = '' , $account_type = '' , $email = '') { $query = $this->db->get_where($account_type , array('email' => $email)); if($query->num_rows() > 0) { $email_msg = "Your account type is : ".$account_type."<br />"; $email_msg .= "Your password is : ".$new_password."<br />"; $email_sub = "Password reset request"; $email_to = $email; $this->do_email($email_msg , $email_sub , $email_to); return true; } else { return false; } } function contact_message_email($email_from, $email_to, $email_message) { $email_sub = "Message from School Website"; $this->do_email($email_message, $email_sub, $email_to, $email_from); } function personal_message_email($email_from, $email_to, $email_message) { $email_sub = "Message from School Website"; $this->do_email($email_message, $email_sub, $email_to, $email_from); } /***custom email sender****/ function do_email($msg=NULL, $sub=NULL, $to=NULL, $from=NULL) { $config = array(); $config['useragent'] = "CodeIgniter"; $config['mailpath'] = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail" $config['protocol'] = "smtp"; $config['smtp_host'] = "localhost"; $config['smtp_port'] = "25"; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['wordwrap'] = TRUE; $this->load->library('email'); $this->email->initialize($config); $system_name = $this->db->get_where('settings' , array('type' => 'system_name'))->row()->description; if($from == NULL) $from = $this->db->get_where('settings' , array('type' => 'system_email'))->row()->description; $this->email->from($from, $system_name); $this->email->from($from, $system_name); $this->email->to($to); $this->email->subject($sub); $msg = $msg."<br /><br /><br /><br /><br /><br /><br /><hr /><center><a href=\"http://codecanyon.net/item/ekattor-school-management-system-pro/6087521?ref=joyontaroy\">© 2013 Ekattor School Management System Pro</a></center>"; $this->email->message($msg); $this->email->send(); //echo $this->email->print_debugger(); } }