SMTP - subject with uft-8

287 views
Skip to first unread message

Gosforth

unread,
Sep 22, 2017, 2:27:44 PM9/22/17
to Fat-Free Framework
Hi,

how to send subject with utf-8 charset using SMTP in F3?

$smtp->set('Subject', "łóćż");

Setting line below changes body char set but not subject

$smtp->set('Content-Type','text/html; charset=UTF-8');

Thanks

ved

unread,
Sep 22, 2017, 7:29:02 PM9/22/17
to Fat-Free Framework
That's curious because I doubted that there was a different encoding setting for subject and body.

It appears to be a common issue that's not really related to F3 and more of a protocol thing (?)

Please take a look at the following resources:


Gosforth

unread,
Sep 24, 2017, 5:38:46 AM9/24/17
to f3-fra...@googlegroups.com
Thanks Ved.

Finally I used example from the first link you posted:

The Content-Type and Content-Transfer-Encoding headers apply only to the body of your message. For headers, there is a mechanism for specifying their encoding specified in RFC 2047.


code:


$smtp->set('Subject', "=?UTF-8?Q?".imap_8bit($subject)."?=");



Must enable "extension=php_imap"


And it works
Reply all
Reply to author
Forward
0 new messages