With Codeigniter 3.1.0, I had the same problem. Missing "\ r \ n" seems to be:
Content-Type: application/pdf; name="test.pdf"<br> Content-Disposition: attachment;<br> Content-Transfer-Encoding: base64<br> JVBERi0xLjYNJeLjz9MNCjQzNyAwIG9iag08PC9MaW5lYXJpemVkIDEvTCA3OTUyMTYvTyA0Mzkv<br> RSA2ODEwODcvTiA0L1QgNzk0ODA3L0ggWyA1NjQgMjYxXT4+DWVuZG9iag0gICAgICAgICAgICAg<br>
it should be:
Content-Type: application/pdf; name="test.pdf"<br> Content-Disposition: attachment;<br> Content-Transfer-Encoding: base64<br> <br> JVBERi0xLjYNJeLjz9MNCjQzNyAwIG9iag08PC9MaW5lYXJpemVkIDEvTCA3OTUyMTYvTyA0Mzkv<br> RSA2ODEwODcvTiA0L1QgNzk0ODA3L0ggWyA1NjQgMjYxXT4+DWVuZG9iag0gICAgICAgICAgICAg<br>
I changed line 725 in system / libraries / Email from
'content' => chunk_split(base64_encode($file_content)),<br>
for image
'content' => "\r\n" . chunk_split(base64_encode($file_content)),<br>
This works for me, but not the perfect solution.
Torsten arendrup
source share