#39066 [Opn->Bgs]: Emailing long strings

From: Date: Fri, 06 Oct 2006 17:00:36 +0000
Subject: #39066 [Opn->Bgs]: Emailing long strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103205@lists.php.net to get a copy of this message
 ID:               39066
 Updated by:       tony2001@php.net
 Reported By:      whomba42 at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Mail related
 Operating System: sun 5.1
 PHP Version:      4.4.4
 New Comment:

PHP doesn't truncate strings, it just passes the data to the mail
server, which can process the data in any possible way.


Previous Comments:
------------------------------------------------------------------------

[2006-10-06 16:50:08] whomba42 at gmail dot com

Description:
------------
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'";
$result=mysql_query($query);
		
while($row=mysql_fetch_assoc($result))
{
	$message.="<strong>$row[title]</strong>";	$paragraphs=explode('</p>',$row['body']);
	$message.=$paragraphs[0];			
// this is what we added as the 'fix' $message.="\n\n";
}
	$to="$email"; 
	$from="someone@somewhere.com"; 
	$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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39066&edit=1


Thread (3 messages)

« previous php.bugs (#103205) next »