|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39066 Emailing long strings
Submitted: 2006-10-06 16:50 UTC Modified: 2006-10-06 17:03 UTC
From: whomba42 at gmail dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.4.4 OS: sun 5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: whomba42 at gmail dot com
New email:
PHP Version: OS:


 [2006-10-06 16:50 UTC] whomba42 at gmail dot com
PHP truncates obscenly large messages during an email rather than wraps it. there was 1022 characters on the line, then it truncated it and discarded all the rest of the code/text.  We read text from the DB (MySQL 5 using php my admin)and it echoed out fine, however during the mail, the last bit of text got cut.  After putting a \n in to the message after each entry and broke up the line it worked fine.

Reproduce code:
$query="SELECT * FROM opendoor_articles WHERE issue_id='$issueID'";
	$message.="<strong>$row[title]</strong>";	$paragraphs=explode('</p>',$row['body']);
// this is what we added as the 'fix' $message.="\n\n";
	$subject="OpenDoor $issueName"; 
	$headers = "From: $from\r\n" .
   	'X-Mailer: PHP/' . phpversion() . "\r\n" .
   	"MIME-Version: 1.0\r\n" .
   	"Content-Type: text/html; charset=iso-8859-1\r\n" .
   	"Content-Transfer-Encoding: 8bit\r\n\r\n";
	mail($to, $subject, $message, $headers);

Expected result:
should have echoed out the message with the code recieved from database.

Actual result:
shows the code up to 1022 characters then dies and goes to the next line.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-06 17:00 UTC]
PHP doesn't truncate strings, it just passes the data to the mail server, which can process the data in any possible way.
 [2006-10-06 17:03 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

It's up to you to provide a valid body for your email messages.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 16:01:27 2023 UTC