#31496 [Opn]: body output of mail() adds eroneous characters breaking output

From: Date: Wed, 12 Jan 2005 17:49:22 +0000
Subject: #31496 [Opn]: body output of mail() adds eroneous characters breaking output
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71970@lists.php.net to get a copy of this message
 ID:               31496
 User updated by:  cessner at centrosus dot com
 Reported By:      cessner at centrosus dot com
 Status:           Open
 Bug Type:         Mail related
 Operating System: Fedora Core
 PHP Version:      4.3.10
 New Comment:

changed:

$headers .= "From: Christian Essner 
<cessner@centrosus.com>\r\n"; 

to

$headers .= "From: Christian Essner 
<cessner@centrosus.com>\r";

no change.

-Christian

Are you able to reproduce the problem?


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

[2005-01-12 05:49:47] jed@php.net

I'm sorry, try dropping the trailing \n. I'm going to sleep.

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

[2005-01-12 05:47:44] jed@php.net

$headers .= "From: Christian Essner <cessner@centrosus.com>\n"; 

Should be:

$headers .= "From: Christian Essner <cessner@centrosus.com>\r\n"; 

I just caught that as I was passing through.

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

[2005-01-12 01:31:31] cessner at centrosus dot com

Here is the code:

http://www.centrosus.com/mail/code.html

You may enter your email address here and have the html 
result sent to your email and check the source yourself 
when you receive the email.

http://www.centrosus.com/mail/enter_email.html

-Christian

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

[2005-01-11 21:15:22] tony2001@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.



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

[2005-01-11 20:36:32] cessner at centrosus dot com

Description:
------------
After asking users to input data into a form an email is 
sent with a summary of the form to people that need the 
information. For some reason the source gets corrupted 
and PHP adds  an "!" in random areas in the body. Note 
the "!" below. This was reproducible in 4.3.9 as well 
and an upgrade did not solve the problem

Feature</span></td><td>NA</td></tr><tr><td>&nbsp;</
td><td><span class="main">Version</span></td><td>NA</
td></tr><tr><td>&nbsp;</td><td><span 
class="main">Build</span></td><td>NA</td></
tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></
tr><tr><td>&nbsp;</td><td><span class="main">Document
tr>!
 Name</sp
an></td><td>test</td></tr><tr><td>

Reproduce code:
---------------
I think you need to have a message body with a lot of characters in
order to reproduce. I am using a style sheet as well built into the
html page that is sent.

Expected result:
----------------
clean html output to be displayed in the email client.

Actual result:
--------------
broken html output. The above source looks like this:

Total Failures
< span class="main">Total Untested 
Overall Status 
 
Where the html is now exposed to the page because of 
broken tags.


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


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


Thread (19 messages)

« previous php.bugs (#71970) next »