i can’t get the new password-reset via email to work on the server (hosteurope).
when i test the general functionality on the server, this works:
mail ('email@example.com', "Test", 'works!', '', "-f firstname.lastname@example.org");
as i know that hosteurope requires the ‘-f param’ my configuration in kirby looks like this:
'email' => [
'presets' => [
'contact' => [
'from' => 'email@example.com'
phpinfo() gives me the following sendmail-path:
/usr/sbin/sendmail -t -i
however, i keep getting the “could not instantiate mail function”-error when trying to use the function
Could you please post the full error output including the stacktrace?
sure! i am working on getting the error-reporting to work on the server …
ok, turns out there is no error being logged! is there anything i can add to the sources that will produce a helpful output?
You can enable the
debug mode to get a full error output:
Please take a look at your browser’s debug console and also at the HTTP response output from the API in the network tab.
unfortunately, this is all i get:
also enabling debug-mode in kirby does not yield any further details…
i went into the code of PHPMailer.php and it turns out, if i change line 1814 from
$params = sprintf('-f%s', $this->Sender);
$params = sprintf('-firstname.lastname@example.org', $this->Sender);
it works. So the
email.presets.contact.from defined in the config is not being passed as "Sender’ to the PHPMailer. Should this be the case?
EDIT: $this->Sender is always a generic email, in my case: “email@example.com”!? how do i pass the Sender into PHPMailer?
Ah, that explains it! You can override the sender address for password reset emails with the
contact preset doesn’t apply to the password reset emails (that don’t use the preset), which is why you are currently always getting the generic noreply sender.
Thanks Lukas! So many options, blessing and curse at the same time -