Page 1 of 1

PHP 5 vs PHP 7 using mail function

Posted: Fri Sep 07, 2018 4:52 pm
by rvos
Hai Pablo,

here is a question. When setting the website using PHP5 and sending a email with the default settings when using a form everything is going well. So far so good. ;-) When changing the PHP version to PHP 7 i receive an error mail telling me : malformed address: "emailadres" may not follow "emailadres" where "emailadres" is a existing emailadres offcourse.

I looked at the difference between the published pages and found a different line.
PHP5 : mail($mailto, $subject, $body, $header);
PHP7 : mail("{$mailto} <{$mailto}>", $subject, $body, $header, '-f'.$mailfrom);

Removing the <{$mailto}> did the trick only after exporting again it's back offcourse.
Is there a way to solve this or is it a bug or something the website side has to agree with. The php version on the website is 7

Thanks for your time and keep up the good work. I really like the program.

Rob

Re: PHP 5 vs PHP 7 using mail function

Posted: Fri Sep 07, 2018 5:12 pm
by Pablo
This is not a bug. This was internally implemented because for some servers this is a requirement.
Actually the only difference between PHP5 and PHP7 option is this code. So, normally PHP5 is the best choice.

If set to PHP5 then MySQLi database functions will be used.
If set to PHP7 then all 'mailto' function calls will be compatible with PHP7 for some servers. Of course PHP7 will also use MySQLi database functions.

Re: PHP 5 vs PHP 7 using mail function

Posted: Fri Sep 07, 2018 7:37 pm
by rvos
Hi Pablo,
thanks for your quick response. I believe that PHP version 5 is going to be out of support so using 7 is going to be the best version. Am I right ?
Do i have to change something at the serverside to get rid of the email errors i receive or is that something what can be done in QWB ?

Thanks again.

Re: PHP 5 vs PHP 7 using mail function

Posted: Fri Sep 07, 2018 8:20 pm
by Pablo
'PHP5' means 5.5 and up.
Do i have to change something at the serverside to get rid of the email errors i receive or is that something what can be done in QWB ?
Please only use PHP7 if your host requires this type of email formatting.
PHP5 is the default and good for most web servers.

Re: PHP 5 vs PHP 7 using mail function

Posted: Fri Sep 07, 2018 8:23 pm
by rvos
Pablo, thanks for your quick response and the answers.

QWB rocks !!