I was wondering if anyone here with experience of PEAR mail or PEAR mail queue could help me out with this.
I am working on creating a bulk mailing service using PEAR and am adding X-headers to give information on where and when people signed up.
So am am trying to create a X-header similar to this:
X-Subscription: Subscribed on 2010/09/01, via web form, by 92开发者_如何学运维.8.196.121 from http://mydomain.com/signup.htm
However after I pass the headers to PEAR mail mime and queue they are formatted with a line break at certain points so they end up looking like this:
X-Subscription: Subscribed on 2010/09/01, via web form, by 92.8.196.121 from
http://mydomain.com/signup.htm
I have tested this by creating a few different headers and the line break always comes after a certain amount of characters but I cannot seem to find any code in PEAR which would cause this.
Does anyone here have any experience of this? Or know of a way I could fix this?
Thanks for looking
The "issue" of headers being split onto multiple lines is correct behavior according to RFC 822, section "3.1.1. LONG HEADER FIELDS":
For convenience, the field-body portion of this conceptual entity can be split into a multiple-line representation; this is called "folding". The general rule is that wherever there may be linear-white-space (NOT simply LWSP-chars), a CRLF immediately followed by AT LEAST one LWSP-char may instead be inserted.
As described in What is the email subject length limit?, RFC 2822 suggests to keep a line length of 78.
精彩评论