q-coding in addCustomHeader with List-Unsubscribe link

414 Views Asked by At

I have a problem with PHPMailer and List-Unsubscribe header. According to the documentation I am trying to add a header for unsubscribing from emails in the mail UI:

$mail->addCustomHeader("List-Unsubscribe", '<'.$unsubscribe_uri.'>');

In general, the unsubscribe link looks like:

$mail->addCustomHeader("List-Unsubscribe", '<https://example.com/unsubscribe?ddd=asfsfsdf-asdfasfsaafasfsafsfsdfsdfdsfsdf>');

but in the incoming letters in the headlines I see:

List-Unsubscribe: =?us-ascii?Q?<https://example.com/unsubscribe/=3Fddd=3Dasfsfsdf-asdf?=
 =?us-ascii?Q?asfsaafasfsafsfsdfsdfdsfsdf>?=

I understand that PHPMailer strives to comply with RFC 2047, but the largest sites (twitter, facebook, paypal) in their newsletters do not encode unsubscribe links. Yandex-mail technical support directly replied that it is better to avoid q-coding in The list-Unsubscribe header in emails. How to be, colleagues?

0

There are 0 best solutions below