langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
53.7k stars 7.86k forks source link

Failed to receive email after adding member's email address. #11315

Closed jingzl closed 11 hours ago

jingzl commented 12 hours ago

Self Checks

Dify version

0.12.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When adding a member in the settings and entering the email address, the email is not received.

.env config:

MAIL_TYPE=resend

MAIL_DEFAULT_SEND_FROM=no-reply@dify.ai
RESEND_API_KEY=re_C25VbtUK_xxxxxxxxxxxxxxxxxxx

SMTP_SERVER=smtp.qq.com
SMTP_PORT=465
SMTP_USERNAME=xxxx@qq.com
SMTP_PASSWORD=xxxxxxxxxxxxxxx
SMTP_USE_TLS=true
SMTP_OPPORTUNISTIC_TLS=false

Regardless of choosing to resend or using SMTP, the email is not received.

✔️ Expected Behavior

the email is received.

❌ Actual Behavior

Regardless of choosing to resend or using SMTP, the email is not received.

dosubot[bot] commented 12 hours ago

To address the issue of not receiving emails when adding a member in Dify version 0.12.1, consider the following potential configuration issues:

  1. MAIL_TYPE Not Set: Ensure that the MAIL_TYPE is correctly set in your configuration. If it is not set, the mail client will not be initialized.

  2. API Key for Resend: Since you are using the "resend" mail type, verify that the RESEND_API_KEY is correctly set. If it is not set, emails will not be sent.

  3. SMTP Configuration: Double-check that SMTP_SERVER and SMTP_PORT are correctly configured. These are essential for SMTP mail type.

  4. TLS Configuration: Ensure that if SMTP_OPPORTUNISTIC_TLS is enabled, SMTP_USE_TLS should also be enabled. Otherwise, it may cause issues.

  5. Default Send From Address: Make sure MAIL_DEFAULT_SEND_FROM is set if no from_ address is provided when sending the email.

  6. Recipient, Subject, and HTML Content: Ensure that the to, subject, and html parameters are provided when calling the send method.

After making any changes to the configuration, restart the service to apply the changes using:

docker compose down
docker compose up -d

Additionally, check if the email service is functioning correctly and verify whether the email has been placed in the trash or spam folder [1][2].

To continue talking to Dosu, mention @dosu.

crazywoola commented 11 hours ago
MAIL_DEFAULT_SEND_FROM=no-reply@dify.ai

You need to change this to your own email sender. Eg. If you choose the SMTP, set it to xxxx@qq.com. If you are using resend, make sure you have passed the domain validation according to their docs.