|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8734 Unable to send large emails, causes a GPF - small email work fine.
Submitted: 2001-01-16 07:40 UTC Modified: 2002-08-23 21:25 UTC
From: wayne dot cope at sitel dot co dot uk Assigned: hholzgra (profile)
Status: Closed Package: Mail related
PHP Version: 4.0.4pl1 OS: Windows NT 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 + 11 = ?
Subscribe to this entry?

 [2001-01-16 07:40 UTC] wayne dot cope at sitel dot co dot uk
When sending attached files (test file is only 14K), a GPF is caused by the mail() function.  When the file is small (e.g. 1K) the function works fine.

I have checked the ini file settings and all seems fine, and have run the same code on version 4.0.4 and it also crashes then too.  I am unable to check on any other versions.  I would guess it's a similar problem to the other "malloc problem" in this section (bug report: 8360) as it would appear to be a memory issue.

Let me know if you need any more info...
Wayne Cope.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-16 08:25 UTC] wayne dot cope at sitel dot co dot uk
I have checked the source code for the Windows version of the mail() function and have determined that there is a 4K limit to the mail buffer - which is nowhere near enough.  The line is:

#define  MAIL_BUFFER_SIZE		(1024*4)	/* 4k buffer */

Which can be found in "sendmail.h" under the Win32 compilation.

I can't compile the code to check for sure, but it does look like this is the problem.

C'ya !
Wayne Cope

 [2001-01-16 11:47 UTC] wayne dot cope at sitel dot co dot uk
I have been able to make the change and recompile the code to use a 1Mb buffer, instead of a 4K buffer and the mail() function works fine now.

You need to change the line
#define  MAIL_BUFFER_SIZE		(1024*4)	/* 4k buffer */

#define  MAIL_BUFFER_SIZE		(1024*1024)	/* 1Mb buffer */

in file "sendmail.h" to make this function work.

Ideally, the buffer size should be calculated dynamically, but that'll take a bit longer of course !

Can someone try and pop this change into the next release please.

Wayne Cope

 [2001-01-30 05:03 UTC]

 [2001-06-22 18:33 UTC]
see #11165
 [2002-04-10 19:10 UTC] dkrout at u dot washington dot edu
Was this bug fixed in 4.1.2?
 [2002-04-11 05:49 UTC] wayne dot cope at sitel dot co dot uk
No, this has not been changed in 4.1.2.

I have downloaded the source code for release 4.1.2 and the buffer used for sending mail is still hardcoded to 4K, and so still causes a GPF when trying to send an email larger than 4K (a buffer very easily broken by sending attachments for example).

 [2002-08-23 21:25 UTC]
There were some fixes in this code..please try this snapshot:

 [2003-05-06 07:06 UTC] hassi at palmdevsolution dot com
Hello PHP webmaster,
thanks for hellp
note:knowing my english is bad
my name is Noureddine, i'm a chief developper in company "PalmDev Solution Informatique".
web site =
I have fixe the code in our web site to allow the user to attach 6 files inorder that the total size must be < = 200 ko. 
- upload_max_filesize = 200 ko
- post_max_size = 200 ko
the code is running good If i just attach 1,2 or 3 file.
but if i try to attach 4,5 or 6 file i have that error :
Warning: Msg too big in confirm_top_model.php on line 90
Note: (line 90: line of function email() )
I dont know what can i do for this problem
Thanks to all
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 04:03:37 2021 UTC