0

I am using CodeIgniter for working.I have created a Sign-Up form when a user successfully Sign-Up an activation code will send to his email it gives me the message that email is sent but I am not receiving an email on my Gmail account. I am facing this problem for many days but did not find any solution. Can anyone help?

$string = mt_rand(100000, 999999);


$Message = 'Hi Dear, <br> Your Verification code is: <br> <h3>'.$string.'</h3> <br><br> Thanks';

            $this->email->set_mailtype("html");

            $config = array(
                'protocol' => 'sendmail',
                'mailtype' => 'html',
                'charset' => 'utf-8',
                'wordwrap' => TRUE
            );
            $this->load->library('email', $config);
            $this->email->set_newline("\r\n");
            $this->email->subject('Email Verification');
            $this->email->message($Message);
            $this->email->from('info@techeasesol.com','Kenswag');
            $this->email->to($email);
            $send = $this->email->send();

            if($send) 
            {
                $msg = "Please Check Your Email to Verify your Account";
                $this->session->set_flashdata('success',$msg);
                redirect('code-verify','refresh');
            }
            else
            {
                $msg = "Email Can't Send";
                $this->session->set_flashdata('error',$msg);
                redirect('Auth','refresh');
            }
Salman Iqbal
  • 442
  • 5
  • 23

0 Answers0