php mail function fails without error information

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

php mail function fails without error information

Post by Oleg »

I am bothered by cases such as this one (not yet approved at the time of this posting) where mail() apparently fails but no information is logged as to the cause of the failure.

Looking at mail documentation it seems that it prints warnings when certain situations happen:
Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows.
Could we perhaps install a special error handler around mail() calls that would catch these and log them to the error log?
User avatar
ameeck
Registered User
Posts: 86
Joined: Sun Nov 13, 2005 6:43 pm
Location: Prague, Czech Republic
Contact:

Re: php mail function fails without error information

Post by ameeck »

From my experience you can hardly get any information from mail() at all.

The most common reason for a phpBB mail() call to fail is breaching the host's outgoing server limits, which are not passed on to the mail() function.

You can encourage the users to start using SMTP, which gives them a full trace.
Please think before you post.
Post Reply