CodeIgniter Forums
Email not working with sendmail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Email not working with sendmail (/showthread.php?tid=63923)



Email not working with sendmail - shanavas_m - 12-23-2015

I am trying to send email using sendmail.
Below is my email.php config file.

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;


The email->print_debugger() gives

Exit status code: 64
Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.

But sendmail works in CLI

Am I missing something?

Thanks in advance Smile


RE: Email not working with sendmail - skunkbad - 12-23-2015

It sounds like PHP is lacking a sendmail extension, or is not properly configured to send email through sendmail. I've never used sendmail, only SMTP and mail, so just answering based on the error you provided.


RE: Email not working with sendmail - Happy Camper - 12-24-2015

Similar to above, I've never used sendmaiil so can't really help here.

Have you tried using phpMailer

https://github.com/ivantcholakov/codeigniter-phpmailer  

I find it works great however I had to modify database.php in config folder to add elements to config array for MySQL port and socket


RE: Email not working with sendmail - shanavas_m - 01-01-2016

Thank you for your assistance.

I figured it out. It was due to the use of simultaneous use of -r and -f options in the command that codeigniter uses.

https://github.com/bcit-ci/CodeIgniter/issues/4343