|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18723 what does mail() function return?
Submitted: 2002-08-03 08:13 UTC Modified: 2002-08-04 10:13 UTC
From: asif at evoknow dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.2.2 OS: windows2K
Private report: No CVE-ID: None
 [2002-08-03 08:13 UTC] asif at evoknow dot com
The mail() function is supposed to return FALSE if it can't send the mail. But in reality it doesn't do so. It always returns TRUE.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-03 09:17 UTC]
It should return FALSE if the mailserver, for any reason, doesn't accept the message. If the mailserver accepts the message but bounces it, PHP can't do anything about it.
Is this the case?
(BTW: you probably want to try a non-STABLE snapshot from, there were many changes to the mail handling stuff on Windows)
 [2002-08-04 07:45 UTC] asif at evoknow dot com
If that is the case, Don't you think that the manual should be updated that says: "mail() returns TRUE if the mail is successfully sent, FALSE otherwise."?
 [2002-08-04 10:13 UTC]
This is what the manual says, and that's correct:
"mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise."
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 19:03:40 2023 UTC