Email test fails but PHP *can* send email

Permalink
V5.8.2

The C5 dashboard email test for default PHP fails with:
The following error was found while trying to send the test email:
Unable to send mail: Unknown error

However doing putting mail('[email protected]', 'test', 'testing'); into the package's controller on_start() result in an email arriving immediately in my inbox after a page load so Apache php.ini is obviously fine and email through default PHP certainly works.

So what's going on?

surefyre
View Replies:
surefyre replied on at Permalink Reply
surefyre
Even more bizarrely using the C5 own mail object works perfectly:
$mail = \Core::make('mail');
        $mail->setTesting($testing);
        $mail->setBody("Dear concrete5 team\nYour CMS is by far the best I\'ve ever seen.");
        $mail->addParameter('mailContent', $body);
        $mail->load('default', 'packagehandle'); // add any parameters before loading the template
        $mail->setSubject($subject);
        $mail->from($from, $from_name);
        $mail->to($to);
        $mail->sendMail();


But writing my own email class isn't going to suddenly make system generated emails like registration validation suddenly start working.