Why won't this email come out correctly with UTF8?


I’m at a bit of a sticking point here. I just can’t figure out what’s going on. Basically, we have a system where customers can email in on a unique email address, and it will then forward the email on to the other person (based on the unique ID they send to). Hopefully I have the right forum here (it’s a bit of an unusual subject)

So, that all works fine. The issue I’m having, is that in a couple of random cases, the messages didn’t get shown in UTF8. Here is an example:

From xxxx@gmail.com Tue Sep 20 09:51:19 2016
Received: from mail-io0-f182.google.com ([xx.xx.xx.xx]:33692)
        by xx with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
        (Exim 4.86_1)
        (envelope-from <xxx@gmail.com>)
        id 1bmFpi-0002d8-CR
        for unique_id@resa.chambresdhotes.org; Tue, 20 Sep 2016 09:51:19 +0200
Received: by mail-io0-f182.google.com with SMTP id r145so11953929ior.0
        for <unique_id@resa.chambresdhotes.org>; Tue, 20 Sep 2016 00:50:54 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Tue, 20 Sep 2016 00:50:32 -0700 (PDT)
In-Reply-To: <E1bm6sv-0004Ll-LO@vps2.chambresdhotes.org>
References: <E1bm6sv-0004Ll-LO@vps2.chambresdhotes.org>
From: caprani <xxx@gmail.com>
Date: Tue, 20 Sep 2016 09:50:32 +0200
Message-ID: <CABvcX8_qWvF2oSwvsen_SOLjvZm88nb5BA8D-o+0GXkEF0WUrw@mail.gmail.com>
Subject: Re: Demande de reservation du www.chambresdhotes.org - Reservation
 request from www.chambresdhotes.org [#123456]
To: lecardonnel <unique_id@resa.chambresdhotes.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-0.4
X-Spam-Score: -3
X-Spam-Bar: /
X-Spam-Flag: NO

Cher Monsieur
Comme disponibilit=C3=A9, je peux vous proposer un g=C3=AEte dans les commu=
ns du
ch=C3=A2teau au tarif de 220EUR  pour les 3 nuits, toutes charges inc=

However, rather than formatting the words correctly, its showing them as the values, like =C3=AE . Please see image below:

It’s almost like its not recognizing the utf-8 header:

Content-Type: text/plain; charset=UTF-8

(I’ve even tried with “UTF-8” in quotes, but that didn’t make a difference).

Any suggestions as to what I could try, would be much appreciated. I’m sure I have it all setup correctly, but I have to be missing something :confused:



1 Like

Typical - I’ve been battling this for a day, and almost as soon as I post the question, I find the answer :wink:

The Content-Transfer-Encoding header wasn’t being copied over correctly. Updated it to include this when it existed in the original:

Content-Transfer-Encoding: quoted-printable

…and voila, it works :slight_smile:


posting a question has you thinking about the problem in a slightly different way to trying to solve it yourself - that change in thinking often makes the answer obvious.


Tell me about it :slight_smile: Kinda wish I’d started writing the post a few hours earlier… but wanted to try all I could, before asking for help lol

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.