i am having a trouble in my codeigniter sending a test message for my gmail. There are no errors displayed but when i check my mail. there is nothing. I already setup my mail to Allow less security for apps and still i haven't receive any mail. Please help me.
also i am using hostgator as for my domain
Here is my code from controller:
function __construct() {
parent:: __construct();
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'mymail@gmail.com',
'smtp_pass' => 'xxxxxxxxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email',$config);
}
public function emailme() {
$message = $this->input->post('email_msg');
$this->email->from('mymail@gmail.com', 'John');//your mail address and name
$this->email->to('mymailtest@gmail.com'); //receiver mail
$this->email->subject('testing');
$this->email->message($message);
$this->email->send(); //sending mail
}