php - Swiftmailer: Missing space in subject email -
i'm using swiftmailer (v 4.2.2)
send emails, , observed when swiftmailer construct email, if has long subject, inserts line breaks in header of mail.
subject:
lorem ipsum dolor sit amet =?iso-8859-1?q?consect=e9tur?= adipisicing elit
the original subject : lorem ipsum dolor sit amet consectétur adipisicing elit
when send mail (using mandrill, or php mailer local smtp server), receive mail subject lorem ipsum dolor sit amet consectéturadipisicing elit
the space missing, line break inserted in header.
i tried solution on thread : removing \r
in function gettokenasencodedword()
in classes/swift/mime/headers/abstractheader.php
, doesn't seem work.
does have solution this?
thanks in advance.
it looks there issue how swiftmailer generating subject line has special characters, , how mandrill's parser handles those. specifically, appears space before line breaks after special character removed mandrill.
the reason when subject line header split 2 lines, second line indented single space, why you're seeing space removed once mandrill has parsed message : swiftmailer puts 1 single space @ second line of header after special character.
changing language not work me.
at moment, simplest (but ugly) fix change how swiftmailer sends header mandrill.
at lib/classes/swift/mime/headers/abstractheader.php, line 305 replacing
$header->setmaxlinelength(76)
by
$header->setmaxlinelength(998)
fixed me.
although recommended max header size 78 characters long, fine go 998 characters (see rfc 2822 section 2.2.3)