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
SMF 2.0.19 is not compatible with php 8.1.
Highest supported version is 8.0
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
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.
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));
?>
You can not use bits and pieces from one version in an older version
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
2.1.3 works fine with php8 & php8.1, using both php & smtp.