|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29276 Cannot properly send mail via SMTP from PHP 5, but can from previous versions
Submitted: 2004-07-20 11:57 UTC Modified: 2004-08-05 23:19 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Austin519 at aol dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.0.0 OS: Windows XP SP1
Private report: No CVE-ID: None
 [2004-07-20 11:57 UTC] Austin519 at aol dot com
I am currently running PHP5 with Apache 2.0.49 and an open-source shopping cart solution OsCommerce (  The OsCommerce email function is a standard one (I won't paste here) that sends standard or MIME emails depending on what you choose for it to send.  Running PHP 4.3.1 I had no issues sending email, however after successfully upgrading to PHP5, I now receive an error.

As I said, the email function is nothing deviating from most of the general working functions posted on the web.  My php.ini lines that it would be referring to are below (edited out my domain name):

[mail function]
; For Win32 only.
smtp_port = 25

; For Win32 only.
sendmail_from =

Reproduce code:
The specific line the error below refers to is here:
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));

The entire email function is here:

Expected result:
Emails are processed and sent to recipients.

Actual result:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in \path_to_storefront\email.php on line 500

(edited out full path to storefront)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-30 12:55 UTC] mpurdy at vicnet dot net dot au
I have the same problem under Windows 2000 professional.  If I use php-win.exe I can send an email without any problems.  However php-cgi.exe and php.exe produce and error which is 

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in e:\http\mail.php
 on line 4
 [2004-08-05 23:19 UTC] works fine for me. Make sure corrent php.ini files is read by looking at phpinfo() output.
 [2004-08-27 08:19 UTC] pipo dot de dot clown at circus dot horlepiep dot com
I had the same problem. It seamed that php.ini is not read.
If I put php.ini in the c:\windows directory all was fine.

It seems that SetEnv PHPRC in httpd.conf has no effect.
(search for "SetEnv PHRC" on a search engine).
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Jan 30 09:05:52 2023 UTC