Email test fails but PHP *can* send email


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?

View Replies:
surefyre replied on at Permalink Reply
Even more bizarrely using the C5 own mail object works perfectly:
$mail = \Core::make('mail');
        $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->from($from, $from_name);

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