Page 1 of 1

mail() $message truncating

Posted: Thu Dec 29, 2005 8:19 am
by charlie12345
This was posted back in October by someone else, but didn't get any responses.

I am having the same trouble and was wondering if anybody had any suggestions.

I didn't count how many characters it truncated tho...

"Is there a limitation to how long your message can be when using mail()? I load the body of my html formatted email into $message, however it truncates the message around 1021 characters for whatever reason. I have tried removing all the html code from the message and it still truncates at the same amount of characters. "

Thanks for any help.

Regards,
Charlie

Posted: Thu Dec 29, 2005 12:25 pm
by anjanesh
Whats mentioned in PHP' mail() doc, is that Each line should be separated with a LF (\n). Lines should not be larger than 70 characters. - but nothing about size of entire message.

Posted: Thu Dec 29, 2005 1:29 pm
by charlie12345
That was it.
Dunno how I missed the in the manual.
Thanks.

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

Regards,
Charlie