|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-15 20:31 UTC] sab2002a at yahoo dot com
Description:
------------
I have PHP setup as a CGI and am using qmail as my mail server.
When I use the mail() function, on success, I do not get a true return on the function. I get no return.
On failure, I do get a false return.
Reproduce code:
---------------
<?php
if (!mail('email@address.com','test','test','From: email@address.com'))
echo "An error occurred";
else
echo "no error occurred";
?>
Expected result:
----------------
Expect to see "no error occurred" and email sent.
Actual result:
--------------
The email gets sent but I get a "An error occurred" message.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 21:00:01 2025 UTC |
set_error_reporting(E_ALL); ini_set("display_errors", 1);Still the same thing. Here's the code: <?php error_reporting(E_ALL); ini_set("display_errors", 1); if (!mail('email@address.com','test','test','From: email@address.com')) echo "An error occurred"; else echo "no error occurred"; ?> The mail gets delivered and I still get "An error occurred" as the output with nothing else. I'm thinking it may be something to do with the way I'm configuring/compiling. Here's my configure line: ./configure --with-openssl --enable-calendar --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-ttf --with-freetype-dir --with-t1lib --enable-gd-native-ttf --with-gettext --with-gmp --with-iconv --with-mcal --with-mcrypt --with-mhash --with-mime-magic --with-mysql --with-mysql-lib --with-ncurses --enable-pcntl --with-jpeg-dir --with-png-dir --with-zlib-dir --with-tiff-dir --with-pspell --with-mm --enable-sysvsem --enable-sysvmsg --enable-sysvshm --with-xmlrpc --with-iconv-dir --enable-xslt --with-xslt-sablot --with-iconv-dir --with-pear --enable-zend-multibyte --enable-sockets --enable-pcntl --enable-sigchild --enable-libgcc --enable-trans-sid --enable-ftp --with-config-file-path=/usr/local/lib --prefix=/usr/local/php --with-config-file-path=/usr/local/php --disable-cli --enable-force-cgi-redirect --enable-cgi --enable-mbstring