|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14510 Unknown error in mail function
Submitted: 2001-12-14 05:29 UTC Modified: 2002-07-03 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 4 (75.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: davidfelton at codemasters dot com Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.1.0 OS: Windows 2000 Terminal, IIS5
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
38 + 48 = ?
Subscribe to this entry?

 [2001-12-14 05:29 UTC] davidfelton at codemasters dot com
When using the mail function on windows 2000 with IIS5, it just returns 'unknown error' and exits. The mail function works fine on windows 98 with OmniHTTPd.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-14 10:52 UTC]
Can you provide a sample script?
 [2001-12-14 10:58 UTC] davidfelton at codemasters dot com
Well it's pretty straight forward:

$mailsubject="A message from your friend";
$mailmessage="Hello, this is an email sent with PHP";
$mailheaders="From: Dave <>";

 [2001-12-14 12:19 UTC]
What are your INI-settings about mail? I.e., your smtp-server, etc...
 [2001-12-17 04:20 UTC] davidfelton at codemasters dot com
smtp server is set to be localhost, which works fine with php 4.0.6
 [2001-12-18 04:23 UTC] davidfelton at codemasters dot com
So, any other ideas?
 [2002-03-05 09:13 UTC] ibasevitch at homtail dot com
i have the same problme with win nt 4.0 terminal edition.
did you find a solution...?
it seems like it can't find the ini file.
 [2002-03-05 09:53 UTC] davidfelton at codemasters dot com
If your php can't read the ini file (patch of file in phpinfo shows up as c:/winnt/ instead of c:/winnt/php.ini) You need to make sure that php has access to read the php.ini file through your security settings.
My solution to the problem was to replace all the calls to mail() with my own function that writes out the raw emails to the mail pickup folder in c:\inetpub\mailroot\
 - it took ages!
 [2002-04-15 15:28 UTC] jjgracia at lazerpro dot com
I got the same error on Win2000+IIS5. I used this on the php page to overwrite ini values:
ini_set("SMTP","aaaa.xxxx.cccc.gggg");// Add SMTP server IP
mail($mail_to, $mail_subject, $mail_body, $mail_headers);
It seems you have to explicitly tell PHP that Sendmail is not in the server :)
 [2002-06-02 13:48 UTC]
SMTP error reporting has been improved, please try a snapshot from
 [2002-07-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-04-09 02:50 UTC] jie dot li at rdc dot ericsson dot se
Yes, I met the same problem in php server. I use php 4.1.2 for windows binary. And when I use mail() function the error message "unknown error" is issued. I don't know why this action can cause the error. In the php.ini I set like the following:
[mail function]
; For Win32 only.

; For Win32 only.
; sendmail_from = 

; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path =

I can not find any faulty setting in this configuation file. Is there anybody can give me a hand?
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 09:01:24 2021 UTC