Hi I am trying to use PHPMailer Library from GitHUB in my Codeigniter application.
I downloaded the code and unzipped in my applicationlibrary
folder.
So there I have a folder called vendor inside which resides the source code for PHPMailer.
Now I created a File named Bizmailer_Controller.php
.
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
*
*/
class Bizmailer_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
require "vendorphpmailerphpmailerPHPMailerAutoload";
$this->Bizmailer = new PHPMailer();
//Set the required config parameters
$this->Bizmailer->isSMTP(); // Set mailer to use SMTP
$this->Bizmailer->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers
$this->Bizmailer->SMTPAuth = true; // Enable SMTP authentication
$this->Bizmailer->Username = 'user@example.com'; // SMTP username
$this->Bizmailer->Password = 'secret'; // SMTP password
$this->Bizmailer->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$this->Bizmailer->Port = 465;
//return $api;
}
}
Now in my controllers I am trying to load it like this :
$this->load->library('Bizmailer');
$mail = new Bizmailer();
And I Get this error :
An Error Was Encountered
Unable to load the requested class: Bizmailer
So Please guide me how I can load or integrate this library in Codeigniter.
See Question&Answers more detail:os