CodeIgniter Forums
Can't e-mail from CLI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Can't e-mail from CLI (/showthread.php?tid=58530)



Can't e-mail from CLI - El Forum - 06-20-2013

[eluser]wstevens[/eluser]
Code:
sendmail: option requires an argument -- 'f'
sendmail: option requires an argument -- 'f'
sendmail: fatal: usage: sendmail [options]

The code is:
Code:
$this->CI->load->library('email');
  $this->CI->email->clear();
  $this->CI->email->from( $this->CI->config->item('admin_email', 'ion_auth'), $this->CI->config->item('site_title', 'ion_auth') );
  $this->CI->email->to( $email );
  $this->CI->email->subject( 'Ad \'' . $ad_name . '\'  Form Submission' );
  $this->CI->email->message( $form_data );
  $this->CI->email->send();

This code resides in a function called by a cron job. We don't seem to have a problem e-mailing when not using the command line interface calling it from within code igniter using pretty much the same code. Not sure what the problem is?


Can't e-mail from CLI - El Forum - 06-20-2013

[eluser]wstevens[/eluser]
Nevermind we decided to go with Swift Mailer library instead, which is working.