php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26480 mail function does not recognise php.ini settings
Submitted: 2003-12-01 01:07 UTC Modified: 2003-12-01 03:53 UTC
From: kevin dot davies at iinet dot net dot au Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.3.4 OS: Windows 2000
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: kevin dot davies at iinet dot net dot au
New email:
PHP Version: OS:

 

 [2003-12-01 01:07 UTC] kevin dot davies at iinet dot net dot au
Description:
------------
If you try to use mail() under Windows 2000/IIS5 you get a warning. If you add the following lines to the top of your php file the warning goes away.

ini_set("sendmail_from", "username@your.host.com"); 
ini_set("SMTP", "192.168.1.1"); 

It appears that mail() is not reading php.ini settings. The ini file was correct and duplicated in c:\winnt\php.ini and c:\php\php.ini and it made no difference.

Reproduce code:
---------------
<?php
mail("peter@nowhere.com","Hello","Blah Blah");
?>

Expected result:
----------------
It should work without errors.

Actual result:
--------------
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in \modules\Your_Account\index.php on line 680 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-01 01:12 UTC] kevin dot davies at iinet dot net dot au
The discussion thread http://www.nukescripts.net/modules.php?name=Forums&file=viewtopic&p=3627#3627 describes how this bug was found. You can refer to it for more details of this bug.
 [2003-12-01 01:21 UTC] kevin dot davies at iinet dot net dot au
The permissions in windows do not automatically allow access to ini files in the c:\winnt directory. You need to specifically go into the security settings of the file, make sure inherited permissions is ticked and you MUST click apply. 

This has been a bane of running PHP under windows. I should be put into the configuration guide for php that any new php website needs to have the default inherited permissions applied or all sorts of things do NOT work.

File permissions under windows NT are not automatic and MUST be checked.
 [2003-12-01 03:53 UTC] magnus@php.net
Since it wasn't a bug in PHP, Status => Bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC