Welcome Guest, Not a member yet? Register   Sign In
Not sending email? - CodeIgniter.
#1

[eluser]anna16[/eluser]
Hello


When i call this function below it doesn't send an email.
Code:
function email_exist($str)
  {
    //check email if exist in the database
    $query = $this->db->query("SELECT email_address, username, password FROM membership WHERE email_address='$str'");
      foreach ($query->result() as $row)
      {

          $email = $row->email_address;      
          $user = $row->username;
          $pass = $row->password;
      }
        
    if ($query->num_rows() > 0)
    {
      //Email username and password to user
      $this->load->library('email');
          $this->email->set_newline("\r\n");
          $this->email->from('[email protected]', 'Your username & password');
          $this->email->to($email);        
          $this->email->subject('Your username and password from samplesite.org');        
          $this->email->message('Hi, check below,<br><br>username: $user<br>password: $pass<br><br>Thank you.');
      
            return TRUE;
    }
        else
        {
            return FALSE;
        }
  }

There is no error display, Can you give advice please.

Thanks.
#2

[eluser]anna16[/eluser]
no need to reply.

$this->email->send();




Theme © iAndrew 2016 - Forum software by © MyBB