Problems with emails in Laragon; fixed with configuration

Open to all! Ask other shopowners for help.
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Problems with emails in Laragon; fixed with configuration

Post by raiwa »

Not sure if its a 1.1.0.3 issue:
When trying to send e-mail, independent from which notify process, I get infinite loop until timeout.
PHP 8.3, unmodified Phoenix 1.1.0.3, local test installation under Laragon, E-Mail options like default installation. I
Tried also to change the E-Mail configuration settings without success.
Correct and different sendfrom and sendto e-mail addresses.

Anyone can reproduce it or is it on my side?

EDIT: Same from admin -> Tools -> Send Email (doesn't use any notify module)
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by heatherbell »

raiwa wrote: Sun Jul 13, 2025 3:08 pm Anyone can reproduce it or is it on my side?
Works for me on a clean test 1.1.0.3 install, sent OK and received OK (though I forgot to set Configuration>E-Mail Options>E-Mail From to valid email address the first time so it sent but was not received)
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by ecartz »

Infinite loop of what? Browser redirects? Depending on what's looping, what browser you're using might make a difference.
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by raiwa »

Tested with Firefox and Chrome.
In Admin -> Tools-> Send Email:
stays on mail.php?action=preview

In create account when submitting the form, it stays on create account instead to forward to create account success. Culprit is in:
C:\laragon\www\xxxxxxx\includes\system\versioned\1.0.8.5\email.php line 381:

Code: Select all

       return mail($to, $this->ensure_encoding($subject), $this->output, implode($this->lf, $headers), "-f$from_addr");
When I comment out that line it works.

Didn't test yet on a server, only local Laragon.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by raiwa »

heatherbell wrote: Sun Jul 13, 2025 3:46 pm
raiwa wrote: Sun Jul 13, 2025 3:08 pm Anyone can reproduce it or is it on my side?
Works for me on a clean test 1.1.0.3 install, sent OK and received OK (though I forgot to set Configuration>E-Mail Options>E-Mail From to valid email address the first time so it sent but was not received)
Local testinstallation or public server?
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by raiwa »

Update:
Happens also on local 1.1.0.0 but on a 1.1.0.0 Server Installation it works. So must be something on my local Testenvironment.
Would be good if someone could confirm that it works local under Laragon or Xampp.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by ecartz »

Can you surround it with a try/catch?

I wouldn't expect it to actually work on Laragon or Xampp without a lot of configuration. But mail usually does nothing rather than failing catastrophically.

Code: Select all

set_error_handler(function($errno, $errstr, $errfile, $errline ){
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});

try {
    return mail($to, $this->ensure_encoding($subject), $this->output, implode($this->lf, $headers), "-f$from_addr");
} catch (Exception|TypeError $e) {
    var_dump([$e, $to, $subject, $headers, $from_addr, $this]);
    return false;
}
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by burt »

I use Laragon. Default installation of Laragon, and default of 1103.

Admin > Tools > Send email seems to work no problem.
em-1.png
Using Laragons popup Email viewer thing;
em-2.png
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by heatherbell »

raiwa wrote: Sun Jul 13, 2025 5:04 pm Local testinstallation or public server?
On a host server, we don't use local.
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Post by raiwa »

Thanks all for looking into this.
I did some more tests:
It works on hosted server.
On Laragon, when I switch to PHP 8.0, the page doesn't stuck, but I do not get the popup preview like Gary.
On Laragon under PHP 8.2-8.3 the page stucks, but with Mat's debug code doesn't register any PHP error.

On Laragon PHP 8.0 and unmodified Phoenix 1.1.0.3, Matt's debug code throws:

Code: Select all

Fatal error: Uncaught ErrorException: Undefined array key "sendEmailToUserAction" in C:\laragon\www\PhoenixCart-1.1.0.3\includes\system\versioned\1.0.8.1\hooks.php:149 Stack trace: #0 C:\laragon\www\PhoenixCart-1.1.0.3\includes\system\versioned\1.0.8.1\hooks.php(149): email->{closure}(2, 'Undefined array...', 'C:\\laragon\\www\\...', 149) #1 C:\laragon\www\PhoenixCart-1.1.0.3\admintest\includes\actions\mail\send_email_to_user.php(54): hooks->cat('sendEmailToUser...') #2 C:\laragon\www\PhoenixCart-1.1.0.3\admintest\includes\segments\process_action.php(19): require('C:\\laragon\\www\\...') #3 C:\laragon\www\PhoenixCart-1.1.0.3\admintest\mail.php(33): require('C:\\laragon\\www\\...') #4 {main} thrown in C:\laragon\www\PhoenixCart-1.1.0.3\includes\system\versioned\1.0.8.1\hooks.php on line 149
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply