public function __construct() { // Include external module require BASE_URI . 'app/vendor/phpmailer/PHPMailerAutoload.php'; // Get settings $settings = MailHelperModel::getSettings(); // Create PHPMailer instance $this->phpmailer_instance = new PHPMailer(); //$mail->SMTPDebug = 3; // Enable verbose debug output // Settings can be changed on the settings page $this->phpmailer_instance->isSMTP(); $this->phpmailer_instance->Host = $settings['email_host']; $this->phpmailer_instance->SMTPAuth = true; $this->phpmailer_instance->Username = $settings['email_username']; $this->phpmailer_instance->Password = $settings['email_password']; $this->phpmailer_instance->SMTPSecure = 'tls'; $this->phpmailer_instance->Port = $settings['email_port']; $this->phpmailer_instance->setFrom($settings['email_from_email'], $settings['email_from_name']); }
public function viewSettings() { $session = new SessionHelper(); // Instance used for data on page $user = new User(); if ($this->_authCheck()) { if ($this->role == 1) { $data = MailHelperModel::getSettings(); $page_title = 'Settings'; include BASE_URI . 'app/view/user/template/header.php'; include BASE_URI . 'app/view/user/settings.php'; include BASE_URI . 'app/view/user/template/footer.php'; } else { // Not an admin $session->setMessage('No Access', 3); $this->viewDashboard(); } } else { // Not logged in $this->viewLoginPage(); } }