This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

gabor19990
gabor19990

Hello,

i made a small mail template just for testing purposes:


subject = "teszt tárgy"

Hi,

ÁRVÍZTŰRŐ tükörfúró

{{ myText }}


i try to send a mail based on this with the following code:

        Mail::send('acme.myplugin::mail.newsletter', array('myText'=>'--teszt árvíztűrő--'), function($message) {

            $message->to('my@address.com', 'Horn Gábor');
            $message->subject('új tárgy');

        });

the email arrives, the subject displays correctly "új tárgy" with proper characters, but the message body has unreadable content both from the template file part, and the myText variable:


Hi ,

ÁRVÍZTŰRŐ tükörfúró --teszt árvíztűrő--


If i use the 'log' driver i can see this in log:

[2016-11-08 23:12:02] production.DEBUG: Message-ID: 672607be9ff327e1a6d8f4626536b072@swift.generated Date: Tue, 08 Nov 2016 23:12:02 +0000 Subject: =?utf-8?Q?=C3=BAj_t=C3=A1rgy?= From: XXXX YYY@yyy.zz To: Horn =?utf-8?Q?G=C3=A1bor?= my@address.com MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">


that is some strange encodings for the hungarian characters, and i don't know the reason for it. I use the Triasrahman.Premailer plugin, but it is same without that too.

regards, Gabor

gabor19990
gabor19990

To help isolate the problem i tried also send as raw:


        Mail::send([
            'text' => 'árvíztűrő',
            'html' => '<strong>árvíztűrő</strong>',
            'raw' => true
        ], array(), function($message) {

            $message->getSwiftMessage()->setCharset('utf-8');
            $message->getSwiftMessage()->setEncoder(Swift_Encoding::get8BitEncoding());;
            $message->to('my@address.com', 'Horn Gábor');
            $message->subject('új tárgy - 2');

        });

this also renders HTML emai incorrectly (i tried with and without setCharset() and setEncoding() using different encodings), althought the Text email is correct this time:


MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_=_swift_v4_1478651641fe16f55f6a35fefe76446eb82603aa04=_"

--_=_swift_v4_1478651641_fe16f55f6a35fefe76446eb82603aa04_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=C3=A1rv=C3=ADzt=C5=B1r=C5=91

--_=_swift_v4_1478651641_fe16f55f6a35fefe76446eb82603aa04_=_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w=
3.org/TR/REC-html40/loose.dtd">
<html><body><strong>&Atilde;&iexcl;rv&Ati=
lde;&shy;zt&Aring;&plusmn;r&Aring;&#145;</strong></body></html>
--_=_swift_v4_1478651641_fe16f55f6a35fefe76446eb82603aa04_=_--

can somebody please try the above code and give feedback about it?

thanks, Gabor

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.