mail() Function truncating the body text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

mail() Function truncating the body text

Post by SBukoski »

I have a PHP script that I could swear was working properly before. I just noticed the other day now that it is sending out e-mails using the mail() function and always truncates the body after so many characters. After saving the e-mails to HTML and looking at them, it's always exactly 1,100 bytes.

Does anyone have any idea why the body text could be getting truncated?
lcidw
Forum Commoner
Posts: 58
Joined: Mon Apr 28, 2003 8:55 am
Location: Netherlands

Post by lcidw »

Some mailservers block messages with more than 1024 Characters in a single line.

Solution: just add a simple linebreak (\n) after the last space before each character 1024

You could possibly use wordwrap() for this.
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post by SBukoski »

Thanks a lot! That did the trick...
Post Reply