0

I have a heredoc var. in php and sending it via POST to an mail.php - everything worked fine, but since web.de and gmx.net are such tools they won´t accept my mails "String too Long 500..." - using chunk_split solved the problem:

$text1 = chunk_split($text1, 1212,"\r\n");

But now the layout is screwed up sometimes. So instead of Hello there... It makes an empty space Hello t here...

Any ideas?

John Conde
  • 217,595
  • 99
  • 455
  • 496
Isengo
  • 2,004
  • 3
  • 21
  • 43

1 Answers1

0

It depends on the type of content.

If your content is HTML, one way to handle it is to run the content through tidy::repairString.

If your content is text (without a structure and formatting language), breaking long lines during mail transfer is one of the things quoted-printable encoding does. Run your content through that. Send your message with a header named Content-Transfer-Encoding with value QUOTED-PRINTABLE. Mail clients will automatically put the content back together before displaying it.

minopret
  • 4,726
  • 21
  • 34