News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF 2.0.19 and php 8.1 issue

Started by fun4us, January 29, 2023, 02:16:19 PM

Previous topic - Next topic

fun4us

Hallo,

i have a problem sending notifications emails from smf. Parts of the header become email recipients. I had this in other software also. After changing the code there it worked. Exactly the same forum installation using php 7.4, No problem at all.

Any idea what part of code i have to change?

Kind regards

@rjen

SMF 2.0.19 is not compatible with php 8.1.

Highest supported version is 8.0
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

shawnb61

Note also that even php 8.0 has some issues with php email on linux.  Windows us ok, smtp is ok:
https://github.com/SimpleMachines/SMF/pull/7560
A question worth asking is born in experience & driven by necessity. - Fripp

fun4us

#3
SMF 2.1.3 also seems not to be compatible because i tried to use Subs-Post.php from 2.1.3 with the same result.

fun4us

#4
I swtched back tp php8.0-fpm same Error. Switched back to php7.4-fpm ist works.

php8.0 and 8.1 can send emails without problems. Here some testcode:

<?php
  $msg = "Some text";
  $mailaddress = "[email protected]";     
  $header[] = 'MIME-Version: 1.0';
   $header[] = 'Content-type: text/plain; charset=utf-8';
   $header[] = 'To: '.$mailaddress;
   $header[] = 'From: [email protected]';
   $date = date("l dS of F Y h:i:s A");
   $subject="My message for you";
   $message="\r\n" . $msg . "\r\n" . $date;
   mail ($mailaddress, $subject, $message, implode("\r\n", $header));
?>

Kindred

You can not use bits and pieces from one version in an older version
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fun4us

I know normally not. I compared the code before and there are only small changes compared to 2.0.19. And the function calls seem to be the same.

2.0.19 does not work on Unix with php 8 and 8+ and it looks like the same Problem can be at 2.1.3 an php 8 and 8+.

Thx @ all

shawnb61

2.1.3 works fine with php8 & php8.1, using both php & smtp. 
A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: