php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31496 body output of mail() adds eroneous characters breaking output
Submitted: 2005-01-11 20:36 UTC Modified: 2005-02-17 23:09 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: cessner at centrosus dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4CVS, 5CVS (2005-01-18) OS: Fedora Core
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cessner at centrosus dot com
New email:
PHP Version: OS:

 

 [2005-01-11 20:36 UTC] 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 !
 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-12 01:31 UTC] 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-12 19:38 UTC] cessner at centrosus dot com
I think I found the problem. There seems to be a limit 
for the message body in html and potentially text output 
as well at 2040 characters for mail(). I ran a few tests 
using different forms and different input and the "!" is 
added always as the 2041st character.

-Christian
 [2005-01-20 01:10 UTC] hholzgra@php.net
Are you sure that this happens in PHP already and not within
your mail transport agent?

All that mail() does on UNIX is to pipe the message headers 
and body into the local sendmail binary, most issues with
mangled email headers and content happen *after* PHP
has already passed it on to the MTA
 [2005-01-20 01:43 UTC] cessner at centrosus dot com
Well can someone else test it? The code is in the link 
on this bug page. That would be a good place to start.

-Christian
 [2005-02-17 02:44 UTC] sniper@php.net
It's something wrong with your system, this works just fine for me.

 [2005-02-17 23:09 UTC] cessner at centrosus dot com
What environment did you test it in?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 25 18:01:33 2024 UTC