Please note that the forum isn't realy used anymore.

If you have questions, want support or just simply want to talk to us you can find us on slack.

 

Php version upgrade 5.5.19 to 5.5.30

Php got upgraded on my server ( hosted by openminds ) to 5.5.30 from 5.5.19. Now no more mails are delivered using a contactform.Is there any way of get this back to work? ( must be something in the core, the way fork sends mails ). Fork version is still round 3.6.x i think

Fork CMS uses by default the mail() functionality from php which uses the server defaults in php.ini. I had the same issue a month ago. I noticed that suddenly one of my websites at Openminds stopped sending emails from the contact form. I was using the default mail functionality, but switched to SMTP and I suggest you do the same if possible. It's more reliable and some mail servers use smtp verification etc.

You can use the smtp server from Google if you have Google apps emailhosting, or you can use Mailgun (https://mailgun.com/) as SMTP which offers 10.000 emails for free every month but I havent tried it yet. Or you can use the gmail smtp server... Openminds doesn't have a free smtp server as far as I know...

Anyway, I also have a 3.6.6 website running on Openminds with php 5.6 where Fork CMS can't send emails using the mail function. It returns a 500 error when sending an email. I checked it out and it seems the following error causes the mail to fail:

mail(): Multiple or malformed newlines found in additional_header"

This post explains the cause of your (and my) problem. There are now more checks on the header field, which means data which was being stuffed into the header should now really be in the message. And Spoon Library stuffed the whole email message also in the header, which isn't allowed anymore.

Ok, there are several solutions:

  1. Upgrade your fork cms version but that will possibly be a bit hard :). Since Fork CMS 3.9 we use SwiftMailer instead of SpoonMail to send emails with phpmail or smtp. So this problem normally wont happen in new Fork CMS installations.
  2. Start using SMTP, that will work without having this error. I chose this solution and sending emails works on my 3.6.6 website.
  3. I could have a look at the email.php class of Spoon Library to stop injecting the message in the header and start using the message field... But it's quite a lot of work...
  4. Another temporary fix that could work is to change this line to

    $status = mail($this->reformatRecipientString($this->recipients), $this->subject, null, str_replace(array('\r\r', '\r\0', '\r\n\r\n', '\n\n', '\n\0', PHP_EOL . PHP_EOL), '', $headers));
    

I had a similar problem Switched from php to smtp after my host provided me with the specs. localhost port - 25 left user/ password - blank

Comment

The forum is deprecated in favor of our Slack channel, which provides real-time support for your issues.

Join us on Slack here: https://fork-cms.herokuapp.com/