ロリポップでCodeigniterのEmailが動かない
ロリポップのレンタルサーバにCodeigniter2.1.4を設置して、
Emailライブラリでメール送信したが、送信されない。
system/libraries/Email.phpの
_send_with_mail()のmail()で送信しているようだったので、ソースを確認。
.... // most documentation of sendmail using the "-f" flag lacks a space after it, however // we've encountered servers that seem to require it to be in place. if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']))) ....
コメントに、
「sendmailのドキュメントでは -f オプションの後にスペースが無いが、サーバによってはスペースが必要だった。」
みないなことが書いてある。
ということで、試しにスペースを削除してみた。
.... // most documentation of sendmail using the "-f" flag lacks a space after it, however // we've encountered servers that seem to require it to be in place. if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f".$this->clean_email($this->_headers['From']))) ....
するとメールが送信された。