TIPS - How to fix header broken in FuelPHP

Khanh Nguyen • June 21, 2019


FuelPHP was a good framework from beginning. It was super easy, intuitivea and straightforward. Although it lacks some of must-have features such as :

Then, come Laravel and other newer frameworks make FuelPHP become less attrative on GitHub ... So long for introducing part, let me introduce our problem.

1. The problem

When I was using Fuelphp to send email via SES in Japanese the header is completely wrong. 

Here is the header:

Subject: 【Some subject】パスワー
Message-ID: <>
Date: Thu, 13 Jun 2019 10:34:16 +0000
X-SES-Outgoing: 2019.06.13-


MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Of-course, the header is broken, and user can't see any of the contents 😭

2. The solution

After a little time googling, we found this Link Ofcourse, this guy told us the fact that: If your header is more than 18 bytes, your header will be broken and there is no way to fix this ?

Are you fucking kidding me ?? Japanese email is somewhat long and cumbersome, so limit your header under 18 bytes (or 9 kanji characters) is unacceptable. I know what happen when I told my boss about this. So I tried to figure out what is the real problem here :

2.1 The easy way

Because of the encoding header configuration, things has been gone wrong, so the most intuitive way is to disable it.


return array(
    'defaults' => array(
        'encode_headers' => false,

2.2 The hard way

Because encoding header setting need mbstring to be installed, we must have install mbstring first.


Don't have any special thoughts about this problem. I'm considering to move away from FuelPHP to another framework.