phpmail and sendmail functions not working

It appears PHP Mail() and Sendmail are not usable on the site due to server restrictions in place. In order to use PHPMail() ini_restore would need to be enabled. I checked in cPanel and it doesn’t appear to be possible to fully edit php.ini to do this. For Sendmail, escapeshellcmd, similar to PHP Mail() would also need to be enabled.

Is there a solution to this? Or a workaround?

Many thanks in advance.

I’m sorry, but why do you need ini_restore to be enabled to make PHP mail() work? You can just use PHP mail() without editing PHP settings or executing shell commands. What do you use those functions for? If you could include a code snippet to show that, that would help a lot.

Okay, so my sign up page needs to send a verification email to the user. I would also need to send mails within the website between users.

When using php mail() users get this error:

Warning: ini_restore() has been disabled for security reasons in /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail/Transport/Mail.php on line 49

And when using sendmail, users get this error:

Warning: escapeshellarg() has been disabled for security reasons in /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail/Transport/Sendmail.php on line 84

Fatal error: Uncaught RuntimeException: Could not execute sendmail program, path given: ‘/usr/sbin/sendmail -t -i’. in /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail/Transport/Sendmail.php:88 Stack trace: #0 /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail.php(862): CubeMailTransportSendmail->send() #1 /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Ppb/Model/BaseMail.php(0): CubeMail->send() #2 /home/vol14_7/epizy.com/epiz_21187478/htdocs/module/Members/src/Members/Controller/User.php(275): PpbModelBaseMail->send() #3 /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Controller/Dispatcher.php(131): MembersControllerUser->Register() #4 /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Controller/Front.php(411): CubeControllerDispatcher->dispatch(Object(CubeControllerRequest), Object(CubeHttpResponse)) #5 /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Application/Bootstrap.php(235): CubeControllerFront->dispatch() #6 /home/vol14_7/epizy.com/epiz_ in /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail/Transport/Sendmail.php on line 88

Warning: escapeshellcmd() has been disabled for security reasons in /home/vol14_7/epizy.com/epiz_21187478/htdocs/library/Cube/Mail/Transport/Sendmail.php on line 84

Can you help as I’m not php savvy.

Many thanks.

It looks like the problem is not with PHP mail() itself, but how your application is trying to use it. Again, you don’t need to use the ini_restore function to use PHP mail(), but for some reason your application does. Why and how it tries to use the blocked function, I don’t know. The developers of the software are probably more qualified to answer that question.

Thanks for your help. I’ll talk to them about this.

Turns out that I can not use the phpmail() on the free hosted account because it is restricted. I’m almost certain an upgraded hosting plan will resolve this, will it?

@lobell said:
Turns out that I can not use the phpmail() on the free hosted account because it is restricted. I’m almost certain an upgraded hosting plan will resolve this, will it?

Yes, most email related restrictions on InfinityFree are not present on iFastNet.