In CodeIgniter 3 you have to include the parameter:
$config['newline'] = "\r\n";
It just won't work without it.
If you don't care about new lines and you're using CodeIgniter 2 then this config parameter is optional.
Get monthly updates about new articles, cheatsheets, and tricks.