php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4363 mail() Subject header not functioning correctly
Submitted: 2000-05-09 18:13 UTC Modified: 2000-08-21 16:41 UTC
From: sgibson at digitalimpact dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.14 OS: Linux (RedHat 6.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sgibson at digitalimpact dot com
New email:
PHP Version: OS:

 

 [2000-05-09 18:13 UTC] sgibson at digitalimpact dot com
I was using the mail() function to send mail.  It seems to 
be misbehaving on my system.  System information:

   Apache 1.3.12
   PHP 3.0.14
   RedHat Linux 6.2
   Sendmail 8.10.0
   php3.ini: sendmail_path = /usr/sbin/sendmail -t

When I call the mail() function, like this:

   mail( $to, $subject, $message);

The subject is not correctly set.  Instead, the contents
of $message is used for the subject.  It seems to be about
64 to 68 (or so) bytes of $message are used in the subject,
then the remainder of $message is in the body.

Looking at the message in the mailbox, it appears that
the "Subject:" is set to null, then a second "Subject:"
line is created, with the above mentioned actions.

When I test this on:

   UnixWare 7.0.1
   Apache 1.3.6
   PHP 3.0.6
   Sendmail 8.9.1
   
it seems to function correctly.

When using additional headers (after the message), they
get appended to the body of the email, and not set in
the message header.

Very very odd behavior.  

I didn't see any other bug reports regarding this, or any
feature fixes within 3.0.15 or 3.0.16.  It may be an
environment thing.  I.E. Sendmail 8.10.0 and PHP 3.0.14??

v/r
Shane


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-17 10:56 UTC] hholzgra@php.net
can you please give an example of what
you pass as $subject and $message ... ?

(expecially: do you have newline in your subject?)
 [2000-08-19 12:09 UTC] joey@php.net
No feedback for 2 months.
Most likely coding error.
 [2000-08-21 16:41 UTC] sgibson at digitalimpact dot com
It appears that the newline in the subject was the problem.  It would be tremendously nice if these types of 'gotchas' were documented in the documentation.

I'm sorry this issue wasted any time (mostly mine, and PHP bug managers).  Better doc would help, though!  

Otherwise, PHP is the best there is, and it rocks!

v/r
Shane

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 04:01:34 2024 UTC