php.net |  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
Votes:6
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 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: davidfelton at codemasters dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Pull Requests

History

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

$mailrecipient="davidfelton@codemasters.com";
$mailsubject="A message from your friend";
$mailmessage="Hello, this is an email sent with PHP";
$mailheaders="From: Dave <dave@davidfelton.co.uk>";

mail($mailrecipient,$mailsubject,$mailmessage,$mailheaders);
 [2001-12-14 12:19 UTC] sander@php.net
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.
thanks
 [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:
<?php
ini_set("sendmail_from",NULL);
ini_set("sendmail_path",NULL);
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] mfischer@php.net
SMTP error reporting has been improved, please try a snapshot from http://snaps.php.net/win32/php4-win32-latest.zip
 [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.
SMTP = smtp.ericsson.se

; 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-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 03 08:01:28 2024 UTC