[ZendTo] Accentuated characters doesn't show correctly in mails sent by zendto v5

Francis francisd at gmail.com
Fri Feb 2 16:09:46 GMT 2018


2018-02-02 4:26 GMT-05:00 Bocquet Stéphane <Stephane.Bocquet at mediapost.fr>:

> Hello Francis,
>
>
>
> I too have sometimes the problem and we try to figure out what is going on
> as, for me, the problem happens sometimes only.
>
>
>
> I was thinking that it could be a mail server problem, but after some test
> in command line, our mail servers seems ok.
>
> Could you do those tests too ? Here is a script I use on Debian 9.
>
>
>
> #!/bin/sh
>
>
>
> EMAILSUBJECT="Mail pour Stéphane"
>
> EMAILTO="stephane.bocquet at entreprise.fr, stephane at mafamile.fr"
>
>
>
> EMAILMESSAGE="/tmp/emailmessage.txt"
>
>
>
> echo "<html><body>" > $EMAILMESSAGE
>
> echo "<h1>Bonjour,</h1>" >> $EMAILMESSAGE
>
> echo "<p>J'ai besoin d'une mise à jour.</p>" >> $EMAILMESSAGE
>
> echo "<br/>" >> $EMAILMESSAGE
>
> # echo "<p><img src="https://zendtoglbvprd1/images/mediashare.png"
> /></p></br>" >> $EMAILMESSAGE
>
> echo "<p>Cordialement,</p>" >> $EMAILMESSAGE
>
> echo "<p>Votre serveur bien dévoué.</p></body></html>" >> $EMAILMESSAGE
>
>
>
> # mail -a "Content-Type: text/plain; charset=UTF-8" -s "$EMAILSUBJECT"
> "$EMAILTO" < $EMAILMESSAGE
>
> # mail -a "Content-Type: text/html; Content-Transfer-Encoding: 8bit" -s
> "$EMAILSUBJECT" "$EMAILTO" < $EMAILMESSAGE
>
> mail -a "Content-Type: text/html; Content-Transfer-Encoding: 8bit;
> Charset=UTF-8" -s "$EMAILSUBJECT" "$EMAILTO" < $EMAILMESSAGE
>
>
>
> rm $EMAILMESSAGE
>
>
>
> Also, could you send us the result of the “locale” command ?
>
> root at zendtoglbvprd1:/opt/zendto# locale
>
> LANG=en_US.UTF-8
>
> LANGUAGE=
>
> LC_CTYPE="en_US.UTF-8"
>
> LC_NUMERIC="en_US.UTF-8"
>
> LC_TIME="en_US.UTF-8"
>
> LC_COLLATE="en_US.UTF-8"
>
> LC_MONETARY="en_US.UTF-8"
>
> LC_MESSAGES="en_US.UTF-8"
>
> LC_PAPER="en_US.UTF-8"
>
> LC_NAME="en_US.UTF-8"
>
> LC_ADDRESS="en_US.UTF-8"
>
> LC_TELEPHONE="en_US.UTF-8"
>
> LC_MEASUREMENT="en_US.UTF-8"
>
> LC_IDENTIFICATION="en_US.UTF-8"
>
> LC_ALL=
>
>
>
> There should be .UTF-8 in the result of each line.
>
>
>
> Next step, is this happening in all the emails ? or just sometime ?
>
>
>
>
>
Hello,

The problem seem to always occurs. Your script work fine for a plain/text
mail, but not for html. I don't think this is a mail server problem,
because the same server is working fine with others applications that also
send html mails. Locales are also fine:

LANG=fr_CA.UTF-8
LANGUAGE=fr_CA:fr
LC_CTYPE="fr_CA.UTF-8"
LC_NUMERIC="fr_CA.UTF-8"
LC_TIME="fr_CA.UTF-8"
LC_COLLATE="fr_CA.UTF-8"
LC_MONETARY="fr_CA.UTF-8"
LC_MESSAGES="fr_CA.UTF-8"
LC_PAPER="fr_CA.UTF-8"
LC_NAME="fr_CA.UTF-8"
LC_ADDRESS="fr_CA.UTF-8"
LC_TELEPHONE="fr_CA.UTF-8"
LC_MEASUREMENT="fr_CA.UTF-8"
LC_IDENTIFICATION="fr_CA.UTF-8"
LC_ALL=

I think the problem is the mail headers that define the charset as
us-ascii. I did an ugly hack that seem to work fine:

/opt/zendto# grep -R us-ascii -A 1 *
lib/class.phpmailer.php:            //$bodyCharSet = 'us-ascii';
lib/class.phpmailer.php-            $bodyCharSet = 'UTF-8';
--
lib/class.phpmailer.php:            //$altBodyCharSet = 'us-ascii';
lib/class.phpmailer.php-            $altBodyCharSet = 'UTF-8';
--
lib/PHPMailer.php:            //$bodyCharSet = 'us-ascii';
lib/PHPMailer.php-            $bodyCharSet = 'UTF-8';
--
lib/PHPMailer.php:            //$altBodyCharSet = 'us-ascii';
lib/PHPMailer.php-            $altBodyCharSet = 'UTF-8';

I don't suggest to use that hack, but it could help to found the proper
solution.

-- 
Francis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20180202/d6e02395/attachment.html 


More information about the ZendTo mailing list