PHP 5 vs PHP 7 using mail function

Issues related to forms.
Post Reply
rvos
Posts: 3
Joined: Fri May 11, 2018 12:49 pm

PHP 5 vs PHP 7 using mail function

Post by rvos » Fri Sep 07, 2018 4:52 pm

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

User avatar
Pablo
Site Admin
Posts: 2832
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: PHP 5 vs PHP 7 using mail function

Post by Pablo » Fri Sep 07, 2018 5:12 pm

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.

rvos
Posts: 3
Joined: Fri May 11, 2018 12:49 pm

Re: PHP 5 vs PHP 7 using mail function

Post by rvos » Fri Sep 07, 2018 7:37 pm

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.

User avatar
Pablo
Site Admin
Posts: 2832
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: PHP 5 vs PHP 7 using mail function

Post by Pablo » Fri Sep 07, 2018 8:20 pm

'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.

rvos
Posts: 3
Joined: Fri May 11, 2018 12:49 pm

Re: PHP 5 vs PHP 7 using mail function

Post by rvos » Fri Sep 07, 2018 8:23 pm

Pablo, thanks for your quick response and the answers.

QWB rocks !!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests