I have got stucked in sending mail to my gmail using localhost,
Could anyone let me know about how to work with smtp_port, smtp_host and mailpath.
The code of my controller is:
<?php
class Mails extends CI_Controller {
public function __construct() {
parent:: __construct();
}
public function index(){
$config = Array (
'protocol' => 'sendmail',
'mailpath' => '/usr/sbin/sendmail',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 25,
'smtp_user' => 'pratyakshgupta7@gmail.com',
'smtp_pass' => '',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email',$config);
$this->email->from('pratyakshgupta7@gmail.com','admin');
$this->email->to('pratyakshgupta7@gmail.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->set_newline("\r\n");
if($this->email->send() )
{
echo"Email Sent Successfully";
} else {
echo "Mail not sent Successfully";
}
$this->email->print_debugger();
}
}