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

Safemode detection is not working properly #2871

Closed
humpataa opened this issue Feb 10, 2023 · 3 comments
Closed

Safemode detection is not working properly #2871

humpataa opened this issue Feb 10, 2023 · 3 comments

Comments

@humpataa
Copy link

PHPMailer function mailPassthru adds a fifth parameter to mail instead of proper detection (and use four parameters if PHP is in safe mode). This results in a kindof misleading error "Could not instantiate mail function" and the troubleshooting guide wrongly pointing in the direction to search for server issues.
Please either fix the detection, show a proper message and / or adjust the troubleshooting guide.
Took me an hour!
Thank you.

@Synchro
Copy link
Member

Synchro commented Feb 10, 2023

The wiki is editable if you have better references. That error message is nearly always caused by the server not having a local mail server installed. The use of safe mode is relatively rare (I've literally never been asked about it here), but if you've got a better way of handling it, PRs are welcome.

@Synchro Synchro closed this as completed Feb 10, 2023
@Synchro
Copy link
Member

Synchro commented Feb 10, 2023

Actually that's not quite true. In 2016 I said:

Safe mode was deprecated in PHP 5.3 and removed in 5.4 anyway. All mention of it will be going away in future versions of PHPMailer.

@humpataa
Copy link
Author

Right, it's not because of safe mode but it is not a misconfiguration or nothing being installed. It's just configured differently than you expect. mail() is working fine for me, but PHPMailer still crashes. I appreciate your work, but I am not sure why you keep insisting that there is no problem. If you have "literally" never been asked, here it is.

I don't know how to add a PR for the troubleshooting guide. The most simple solution is to set
$mail->UseSendmailOptions = false;
to prevent PHPMailer to pass parameters that may not be suitable for the installed mail system. I believe the fifth parameter is not needed for 99% of the users of PHPMailer. So it would maybe even make sense to make this the default setting.

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

2 participants