Email sending issues


DOLIBARR ENVIRONMENT
- Version: 8.0.0
- Operating System: CentOS 7
- Web Server: Apache
- PHP: 5.6.32
- Database: MySQL
- URL(s): /admin/mails.php?action=test&mode=init#formmailbeforetitle


Upgrade from 7.0.5 to 8.0.0, Email sending no longer working. When click “Send Email” it shows,

This page isn’t working
xxx.xxx.xxx is currently unable to handle this request.
HTTP ERROR 500

Hello, there is no official 7.0.5 version. Unless you meant 7.0.3

Please try updating to 8.0.1 to see if it resolves your issue.

Generally, a 500 error refers to your server. Possibly check with your hosting company too.

Sorry. my mistake. It is 7.0.3. The mail function worked fine with 7.0.3, but not with 8.0.0.

And I just upgrade to 8.0.1 without luck.

The server i host is my own CentOS 7 server.

Hi,

Error 500 means problem on the serveur side.
Could you send us the php error log of your server ?

[Mon Sep 10 12:48:38.533513 2018] [:error] [pid 11763] [client 118.200.231.7:53620] PHP Parse error: syntax error, unexpected ‘?’ in /var/www/domain-erp/htdocs/includes/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php on line 496, referer: http://erp.mydomain.com/admin/mails.php?action=test&mode=init

Now i found the problem that for new system to work, I have to upgrade to PHP 7

In PHP 7 we additionally get the ?? operator which rather than indicating extreme confusion which is how I would usually use two question marks together instead allows us to chain together a string of values. Reading from left to right, the first value which exists and is not null is the value that will be returned.

// $a is not set
$b = 16;

echo $a ?? 2; // outputs 2
echo $a ?? $b ?? 7; // outputs 16
This construct is useful for giving priority to one or more values coming perhaps from user input or existing configuration, and safely falling back on a given default if that configuration is missing. It’s kind of a small feature but it’s one that I know I’ll be using as soon as my applications upgrade to PHP 7.

Great so your solution has worked by upgrading the server php version to 7.0?