0

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
    }
Jc John
  • 1,799
  • 2
  • 34
  • 69
  • why marking as duplicate? we are not in the same problem? – Jc John Jul 05 '17 at 03:12
  • what are you posting is not using CI framework i mean what you said that is duplicate? its not duplicate!. @John Conde – Jc John Jul 05 '17 at 03:30
  • try your host as smtp.gmail.com - thats what we use as our outgoing mail servers in Outlook. – Antony Jul 05 '17 at 08:49
  • I also agree this isn't a duplicate! – Antony Jul 05 '17 at 08:50
  • There are a lot of reasons why email will not reach an inbox and most of them live outside of the code. You need to go through the checklist in the duplicate question and verify that these do not apply to you. Until you do this question is definitely a duplicate. – John Conde Jul 05 '17 at 10:35

0 Answers0