Reputation: 3376
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!
Upvotes: 0
Views: 9104
Reputation: 4033
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';
}
Upvotes: 0
Reputation: 375
This will work, its what am using on my system in one of the controllers..
=========
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());
}
}
Upvotes: 0
Reputation: 63
Mine worked with some minor changes...like:
in library go to ion_auth
: add the set_newline("\r\n")
:
also in config folder go to ion_auth and your email configuration should look like :
But remember the set_newline()
is very very important
Upvotes: 4
Reputation: 1009
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
.
Upvotes: 4