CodeIgniter Forums

Full Version: Password reset not working, form submission not working; Email not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, 

Newbie here. Need help on the email configuration to get it working; the following email config is not working. 

$config['useragent'] = 'CodeIgniter';
$config['protocol'] = 'smtp';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'mydomainnamehost.com';
$config['smtp_user'] = 'myemail.com';
$config['smtp_pass'] = 'mypassword';
$config['smtp_port'] = '587';
$config['smtp_crypto'] = 'tls';
$config['mailtype'] = 'html';
// $config['validate'] = TRUE;
// $config['priority'] = 3;
// $config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['charset'] = "utf-8";

Please advise how I can get this working. Thank you much Blush
Hey,

When sending email, check the debug, it usually tells you why it couldn't send email:

PHP Code:
$this->email->send(false); // false attribute is important, otherwise debug data will be cleared after send action
echo $this->email->print_debugger(); 

This should point you to right direction why it fails.
yes, debugging will help. Also, you can talk to you hosting provider or check your Cpanel for email settings. For example,
Code:
$config['smtp_host'] = 'mydomainnamehost.com';
 
must be

Code:
$config['smtp_host'] = 'mail.mywebsite.com';

for the providers I work with.