Page 1 of 2

Problems with emails in Laragon; fixed with configuration

Posted: Sun Jul 13, 2025 3:08 pm
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)

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 3:46 pm
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)

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 4:26 pm
by ecartz
Infinite loop of what? Browser redirects? Depending on what's looping, what browser you're using might make a difference.

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 5:03 pm
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.

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 5:04 pm
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?

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 5:13 pm
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.

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 5:34 pm
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;
}

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 6:24 pm
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

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Sun Jul 13, 2025 7:50 pm
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.

Re: 1.1.0.3 Questions / Comments / Concerns / Feedback

Posted: Mon Jul 14, 2025 7:32 am
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