CodeIgniter Ion Auth not sending activation email

9k Views Asked by At

I have CodeIgniter Ion Auth configured with the following smtp info:

$config['use_ci_email'] = FALSE;
$config['email_config'] = array(
    'mailtype' => 'html',
    'protocol' => 'smtp',
    'smtp_host' => 'mail.example.com',
    'smtp_user' => '[email protected]', // actual values different
    'smtp_pass' => 'password',
    'smtp_port' => '26'
);

When I register for an account, Ion Auth simply says "Activation email sent" but I see nothing in my inbox (checked spam folder too). I checked the info with a SMTP testing tool, and the SMTP info provided in $config['email_config'] is correct. I followed the Ion Auth documentation, but I am not receiving any emails. Is there anything else that needs to be done? Thanks!

4

There are 4 best solutions below

1
On

Check for

$config['email_activation'] = TRUE; // Email Activation for registration
$config['manual_activation'] = FALSE;  

is configured or not??

Go to config/ion_auth.php, make sure $config['use_ci_email'] is set to TRUE.

0
On

Mine worked with some minor changes...like:

in library go to ion_auth: add the set_newline("\r\n"):

enter image description here

also in config folder go to ion_auth and your email configuration should look like :

enter image description here

But remember the set_newline() is very very important

0
On

This will work, its what am using on my system in one of the controllers..

=========

========USING GMAIL

public function sendmail($data=array())
{


    $config = Array(

    'protocol' => 'smtp',

    'smtp_host' => 'ssl://smtp.googlemail.com',

    'smtp_port' => 465,

    'smtp_user' => '[email protected]',

    'smtp_pass' => 'xxxxxxx',

    'mailtype'  => 'html', 

    'charset'   => 'iso-8859-1',

    'wordwrap'   =>TRUE

);


$this->load->library('email',$config); // Note: no $config param needed

    //$this->email->initialize($config);

$this->email->from('[email protected]', 'Test Mailer');

$this->email->to('[email protected]');

$this->email->subject('Test email from CI and Gmail');

$this->email->message('This is a test, using CodeIgniter Email Class.');

$this->email->set_newline("\r\n");


 if ($this->email->send()) {

     echo 'Your email was sent, thanks.';

  } else {

     show_error($this->email->print_debugger());

  }


}
1
On

try this. i hope it will help you.

$config['email_smtp'] = TRUE;
$config['email_from'] = 'mail.example.com';
$config['email_from_name'] = 'mail';
$config['admin_email'] = 'mail.example.com';
$config['mailtype'] = "html";
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['wordwrap'] = FALSE;
$config['charset'] = "utf-8";

/**
 * SMTP Settings
 */
if ($config['email_smtp'] === TRUE) {
    $config['protocol'] = "smtp";
    $config['smtp_host'] = '[email protected]';
    $config['smtp_port'] = '465';
    $config['smtp_timeout'] = '5';
    $config['smtp_user'] = 'mail.example.com';
    $config['smtp_pass'] = 'password';
}