email using CI
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Mail extends CI_Controller {
function __construct()
{
parent::__construct();
//Do your magic here
$this->load->model('membership_model');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp3.netcore.co.in',
'smtp_port' => 25,
'smtp_user' => 'support@9abusiness.com',
'smtp_pass' => 'Supp0rt',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$this->load->library('email',$config);
}
function send_mail($value='')
{
$message=base_url().'mail/verify_email/'.'916412fceda2a6b7f46f7a544ba33feb';
$this->email->from('support@9abusiness.com', 'Support');
$this->email->to('abdularbaaz@gmail.com');
$this->email->cc('');
$this->email->bcc('');
$this->email->subject('Password Reset');
$this->email->message($message);
if ( ! $this->email->send())
{
// Generate error
echo "Email is not sent!!";
}
echo $this->email->print_debugger();
}
public function index()
{
}
function verify_email($value='')
{
$result=$this->membership_model->verify_email_model($value);
if ($result) {
echo "your email has been verified";
}
}
}
/* End of file mail.php */
/* Location: ./application/controllers/mail.php */