CodeIgniter Ion_Auth :: Forgot Password Doesn't Work

I am having problems with the forgotten password function Ion_Auth.

I downloaded the library and called the function, passing the email address (from the input field).

An email template exists on the server (like all relevant files), and the function actually returns TRUE, checked using the IF NOT statement.

However, no emails are sent. Now I know that the CI email function works, as I did fast mail using the email library and it sent the message without any problems.

I tested the Ion_Auth library and found that it finds the user and generates an email using the template, and it returns TRUE after doing $ this-> ci-> email-> send ()

So how can this be when no letter is received?

+3
source share
2 answers

You can change the default behavior of ion auth by rewriting the email sending code to your own PHP, or you can change the protocol. Go to forgotten_password()and until $this->ci->email->initialize($config);you can do $config['protocol'] = OPTION;where the parameter may be mail, sendmailorsmtp

http://codeigniter.com/user_guide/libraries/email.html

Hope this helps

+1
source

Instead of changing the default behavior of Ion Auth by editing any Ion Auth files ...

According to the CodeIgniter 2 documentation, to configure email sending, follow these steps:

1) , application/config/email.php, :

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL SENDING SETTINGS
| -------------------------------------------------------------------
*/

$config['protocol'] = 'sendmail';  // 'mail', 'sendmail', or 'smtp'
// other email options

/* End of file email.php */
/* Location: ./application/config/email.php */

2) application/config/ion_auth.php TRUE

$config['use_ci_email'] = TRUE;
+6

All Articles