LoginSignup
3
1

More than 5 years have passed since last update.

CodeIgniter Email クラスの罠

Posted at

はじめに

初期化時に crlf と newline を明示的に設定しないと RFC 822 に沿っていないことになります。


$this->load->library('email');

$this->email->initialize(array(
    ... 中略
    'crlf'      => "\r\n",
    'newline'   => "\r\n"
));

なぜデフォルトでそうなっていないのか...(理由はあるのでしょうけれど)。おかげでメールが届いたり届かなかったりしてしまいました。

参考

CodeIgniter Email クラス
http://codeigniter.jp/user_guide/3/libraries/email.html

RFC 2822
http://srgia.com/docs/rfc2822j.html

CodeIgniterでメール送信 - ドキュメント | SendGrid
https://sendgrid.kke.co.jp/docs/Integrate/Frameworks/codeigniter.html

行末は“crlf” => “\r\n” と “newline” => “\r\n”を使用することが重要です。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1