php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20610 sendmail_path does work in Windows too, not only in Unix
Submitted: 2002-11-24 10:38 UTC Modified: 2004-07-27 14:33 UTC
From: dmitry at koteroff dot ru Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0RC1 OS: Windows 95
Private report: No CVE-ID: None
 [2002-11-24 10:38 UTC] dmitry at koteroff dot ru
Mail() function does not work on Win95. Seems to me it simply doesn't call sendmail stub. 

PHP.ini:
sendmail_path = z:/usr/sbin/sendmail -t -i

test.php:
<?mail("test@test.com","sbj","body")?>

z:/usr/sbin/sendmail.exe is a debug stub. It reads STDIN and put data to the file (tested OK on Win2000 & Win95 from command line).

On Win2000 all works correctly, promlems are only on Windows 95.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-24 12:29 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

On windows PHP connects directly to the SMTP specified via the SMTP ini setting, the sendmail_path is only used on UNIX based systems.
 [2002-11-24 12:39 UTC] dmitry at koteroff dot ru
It's a very strange thing, because on Win2000 all works correctly. What's the difference between Win95 and Win2000 in the stage of opening process streams?.. You see that popen() works in both OSes.

By the way, I didn't find in the documentation direct (!) instruction, that sendmail_path does not work on Windows. Maybe it's a documentation problem?..
 [2002-11-24 12:51 UTC] iliaa@php.net
Here in excert from the php.ini file:
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
 [2002-11-28 13:37 UTC] dmitry at koteroff dot ru
Everything works in Win95 too if I use BACKSLASHES instead of strait slashes:

; this is correct in Windows!
sendmail_path = \usr\sbin\sendmail -t -i 

I also watched through the PHP sources - src\php-4.2.3\ext\standard\mail.c - to check if sendmail_path could work in Windows. It can. Always. 

I think you may need to correct php.ini comments about sendmail_path in Windows.
 [2004-03-06 17:53 UTC] mfischer@php.net
I just checked this comments with the sources and I it seems to be true.

The logic says that, if we're on Windows and we have _no_ sendmail_path, we're using the internal smtp machine. However, if we've a sendmail_path, we're using popen() to the sendmail binary.
 [2004-07-27 14:33 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"This directive works also under Windows. If set, smtp, smtp_port and sendmail_from are ignored and the specified command is executed."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 14:01:33 2025 UTC