Chuyển tới nội dung chính

Test email with Mailpit

This guide explains how to send the emails of Casdoor to Mailpit, an SMTP server for testing that catches all messages and shows them in a web UI.


Learning outcomes​

  • Point an email provider at Mailpit.
  • Send a test email and read it in Mailpit.

What you need​

  • Mailpit running where Casdoor can reach it. By default, Mailpit listens on 127.0.0.1:1025 without TLS or authentication.
  • Administrator access to the Casdoor admin console

Run Mailpit​

Start Mailpit, so that its SMTP server is reachable at 127.0.0.1:1025, or at the host and port that you configured.

Mailpit configuration

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Email and Type to Default.

  3. Set Host and Port to the address of Mailpit, for example 127.0.0.1 and 1025. Leave Username and Password empty if Mailpit has no authentication.

    Mailpit settings in Casdoor

  4. Save the provider.

Verify the result​

  1. Click Test SMTP Connection. Casdoor reports SMTP connected successfully.

  2. Click Send Testing Email. Casdoor reports Email sent successfully.

    Test email sent from Casdoor

  3. Open the web UI of Mailpit. The message is there.

    Test email in Mailpit

See also​