Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not instantiate mail function" is not a helpful error message #1288

Closed
ghost opened this issue Dec 13, 2017 · 1 comment
Closed

"Could not instantiate mail function" is not a helpful error message #1288

ghost opened this issue Dec 13, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 13, 2017

Problem description

"Could not instantiate mail function" is not a helpful error message. It seems to be a catch all for many different conditions (invalid parameters like not a valid mail address, problems locating sendmail, no permission to run sendmail, ...). sendmail is installed, so this error message tells me absolutely nothing except that some random thing is wrong. This is extremely frustrating. Therefore, please find a way to provide a better error message.

Code to reproduce

use php mailer example on a system e.g. without sendmail

Debug output

@Synchro
Copy link
Member

Synchro commented Dec 13, 2017

I can't tell. The only thing I have to go on is the boolean returned by the mail() function. PHPMailer isn't (and shouldn't be) responsible for your entire PHP and OS configuration; it's just a small component. That said, you might like to put some effort into the diagnostic utility idea in #612; PRs welcome.

I strongly recommend (as do the docs) not using mail() anyway since it's impossible to use securely, and it's also slower and provides less feedback (as you're finding) than SMTP to localhost.

@Synchro Synchro closed this as completed Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant