fusio icon indicating copy to clipboard operation
fusio copied to clipboard

Sending email success but I didn't receive anything on inbox/spam

Open yeyenpamula opened this issue 1 year ago • 4 comments

@chriskapp Please help, I've set smtp on .env then I tested it to register a new user and reset the password. A registration email or reset password was sent, but I didn't receive an email on inbox/spam.

Screenshot at Feb 29 23-03-39

yeyenpamula avatar Feb 29 '24 16:02 yeyenpamula

Hi @yeyenpamula can show me in which format you have configured the APP_MAILER at the .env file, of course only anonymous to check whether there is a problem?

chriskapp avatar Feb 29 '24 18:02 chriskapp

@chriskapp Thank you for the quick response. I use this format APP_MAILER="smtp://mysmtp%40mydomain.com:[email protected]:465"

I also tried with another format, like use @ on SMTP user, and also changed the port to 25/587 but the result was still the same. I also tried with another SMTP server, and the result was still the same. An email was sent but not any email received in inbox/spam.

yeyenpamula avatar Feb 29 '24 18:02 yeyenpamula

ok, so internally we use the Symfony Mailer component s. https://symfony.com/doc/current/mailer.html you could try the format smtp://user:[email protected]:25, sendmail://default or also native://default to use the SMTP settings configured at the php.ini

chriskapp avatar Feb 29 '24 20:02 chriskapp

After setting up SMTP in the .env file and in the backends config section I had a similar issue when using the /public/consumer/password_reset endpoint.

When executing the endpoint the result would return:

{
  "success": true,
  "message": "Password reset email was send"
}

The payload looks like (since I am not using captcha):

{
  "email": "[email protected]"
}

However the email would never arrive at the specified destination address..

Looking closer.. the fix was to populate the APP_MAIL_SENDER as well as the APP_MAILER fields in the .env file when using SMTP.

For example the .env would look like below:

APP_TENANT_ID=""
APP_PROJECT_KEY="23b765c92fcd51c6772d4b00339c82ff"
APP_URL="http://127.0.0.1/fusio/public"
APP_APPS_URL="http://127.0.0.1/fusio/public/apps"
APP_ENV="prod"
APP_DEBUG="false"
APP_CONNECTION="pdo-mysql://root:@localhost/fusio_db"
APP_MAILER="smtp://[email protected]:[email protected]:587"
APP_MESSENGER="doctrine://default"
APP_MAIL_SENDER="[email protected]"
SDKGEN_CLIENT_ID=""
SDKGEN_CLIENT_SECRET=""

This solved my issue.

I was using v5.1.6 during this testing.

Also when testing out the backend config option for the mailer I first setup the connection like below:

Image

Then I setup the system mailer.

However I noticed the value input field requires the user to type in the value for the mailer...

It may be advantageous to have the field replaced with a select dropdown box in the future so the user doesn't have to copy the name of the SMTP connection it's automatically added here once a SMTP connection is created.

Image

helpful built in consumer API doc link:

https://www.fusio-project.org/api/consumer#tag/account/operation/consumer.account.requestPasswordReset

Cale-Torino avatar Mar 11 '25 11:03 Cale-Torino