Is there a way to get PHPMailer to send SMTP messages with longer than 76 character lines?
I’ve tried
$mail->WordWrap = 0;
But that doesn’t seem to work.
I’ve tried
$mail->Encoding = "8bit";
that doesn’t seem to work either.
The message body is just plain text. I’m needing it to be parsed by another script that I send it to. But I need the body to be completely in one line. That’s how I pass it to $mail->Body.
It may be that the code is sticking to this suggestion from the mail format RFC: “Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.”
PHPMailer seems to split the message to 76 chars if it’s set to Base64 encoding, and if it’s using mail() as the underlying mail transport.
2.1.1. Line Length Limits
…
The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that
simply cannot handle more than 998 characters on a line.
…
The more conservative 78 character recommendation is to accommodate
the many implementations of user interfaces that display these
messages which may truncate, or disastrously wrap, the display of
more than 78 characters per line, …
I guess as long as you know there won’t be any limit problems for your particular use case you could take advantage of the undocumented mail() “feature”. But I have the feeling there may be a better way to do what you want that is not so risky.