Email report question, 'Invalid address: (From): '

hello, when I try to use email report function, I met some problems.

STEP 1:
I follow this site’s guide but I found I can download the report but can not send email, when I click send report now, it showed as belows, said

Error was ‘Invalid address: (From): noreply@localhost:8082’

Manage Email Reports User Guide - Analytics Platform - Matomo

STEP 2:
I followed this guide, and find all these ways didn’t work.
Emails from Matomo are not being sent, how do I troubleshoot and solve the issue? FAQ - Analytics Platform - Matomo

And when I input following command,

./console core:archive

it showed following warnings:

$ ./console core:archive
The system cannot find the path specified.
The system cannot find the path specified.
WARNING [2021-12-11 17:22:07] 6092 E:\nginx-1.20.2\things\matomo\core\CliMulti\Process.php(290): Deprecated - trim(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 4.6.2 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
The system cannot find the path specified.
WARNING [2021-12-11 17:22:07] 6092 E:\nginx-1.20.2\things\matomo\core\CliMulti\Process.php(308): Deprecated - trim(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 4.6.2 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
The system cannot find the path specified.
WARNING [2021-12-11 17:22:07] 6092 E:\nginx-1.20.2\things\matomo\core\CliMulti\Process.php(258): Deprecated - trim(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 4.6.2 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

I’m not sure is this the main reason I can’t send email? I’m using php 8.1 & matomo 4.6.2, is that matters?


when I use PHP version: 7.4.26, the console result become:

2021-12-12 17:10:46 Invalid address: (From): noreply@localhost:8082
ERROR [2021-12-12 17:10:46] 18648 Uncaught exception: E:\nginx-1.20.2\things\matomo\vendor\phpmailer\phpmailer\src\PHPMailer.php(1299): Invalid address: (From): noreply@localhost:8082 [Query: , CLI mode: 1]
[PHPMailer\PHPMailer\Exception]
Invalid address: (From): noreply@localhost:8082
core:test-email emailAddress

Did you try to change the sender email address? I am not sure noreply@localhost :8082 is a valid email address…

I don’t know is the noreply_email_address can set any address I want. But this @localhost:8082 is matomo’s default sending email address I think.
here ‘@xxx.com’ is my company domain.

And I try to change it by add

[General]
noreply_email_address = “matomo@xxx.com
login_password_recovery_email_address = “matomo@xxx.com
login_password_recovery_replyto_email_address = “matomo@xxx.com

and the command showed

$ ./console core:test-email myemail@xxx.com
2021-12-15 07:44:03 Sending with mail()
2021-12-15 07:44:03 Sendmail path:
2021-12-15 07:44:03 Envelope sender: matomo@xxx.com
2021-12-15 07:44:03 To: Matomo User myemail@xxx.com
2021-12-15 07:44:03 Subject: =(this line I delete it to hide some internal url)
2021-12-15 07:44:03 Headers: Date: Wed, 15 Dec 2021 07:44:03 +0000
From: matomo@xxx.com
Message-ID: GOn75zF1kzk9H9kfPE68777BlciEKr3RDVoiQFaljO0@localhost.localdomain
Auto-Submitted: yes
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=“b1_GOn75zF1kzk9H9kfPE68777BlciEKr3RDVoiQFaljO0”
2021-12-15 07:44:03 Additional params: -fmatomo@xxx.com
2021-12-15 07:44:05 Result: false
2021-12-15 07:44:05 Could not instantiate mail function.
ERROR [2021-12-15 07:44:05] 29524 Uncaught exception: C:\ProgramData\Nginx\nginx-1.18.0\php\matomo.dev\vendor\phpmailer\phpmailer\src\PHPMailer.php(1917): Could not instantiate mail function. [Query: , CLI mode: 1]
[PHPMailer\PHPMailer\Exception]
Could not instantiate mail function.
core:test-email emailAddress

It looks still not work.

There is some progress…
The problem has changed… :wink:
Is the mail function activated on your PHP?

sorry I don’t know how to check this.

Ask your PHP administrator…

A great progress! Thanks!
I didn’t open my SMTP in php config file before

[mail function]
SMTP = XXXXX

and after I correct this, I can send following command! I received this test letter!

$ ./console core:test-email myemail@xxx.com

And finally I received the report! Thanks a lot @heurteph-ei