|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38611 Call to undefined function mail()
Submitted: 2006-08-27 01:04 UTC Modified: 2006-08-27 15:17 UTC
Avg. Score:4.0 ± 1.0
Reproduced:0 of 1 (0.0%)
From: ole at gidderikke dot no Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.1.5 OS: Debian GNU/Linux 3.1 (sarge)
Private report: No CVE-ID: None
 [2006-08-27 01:04 UTC] ole at gidderikke dot no
Fatal error: Call to undefined function mail() in /path/file.php on line 1

Reproduce code:
$headers = "From: $name <$frommail>\n";
$mailtext = "Text for the mail.";
mail($tomail, "Subject for the mail", $mailtext, $headers);

php.ini (the path is correct):
sendmail_path = "/var/qmail/bin/qmail-inject"

Expected result:
I expect that PHP will find it's mail()-function. All this code and php.ini worked in earlier versions (not with) than PHP 5.1.4. I don't remember wich version, but I guess it was ~5.1.2. Version running now: 5.1.6 (not 5.1.5).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-27 15:17 UTC]
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 as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.



For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 22:01:31 2024 UTC