Mailpit for local development
Learn how to use Mailpit for local development.
Steps to use Mailpit for local development
Learn how to use Mailpit for local development.
When developing locally, We recommend using Mailpit to capture emails sent during development. This allows you to test email functionality without actually sending emails to real addresses.
What is Mailpit?
Mailpit is a disposable email service that captures all emails sent during local development. It's particularly useful for testing:
- Email verification flows
- Password reset emails
- Team invitations
- Notification emails
- Any other transactional emails
Accessing Mailpit
When running the provided Docker compose file, Mailpit is automatically available at:
http://localhost:8025You can view any captured emails by:
- Going to http://localhost:8025
- Finding your test email in the list of received messages
Common Use Cases
1. Email Verification
When testing user signup:
- Create a new account using any email address
- Go to Mailpit at http://localhost:8025
- Find the verification email
- Click the verification link or copy the verification code
2. Password Reset
To test password reset flows:
- Request a password reset using any email
- Check InBucket/Mailpit for the reset email
- Use the reset link or code to complete the process
3. Team Invitations
When testing team invites:
- Send an invitation to any email address
- Check Mailpit for the invitation email
- Use the invitation link to accept
Mailpit vs Production Emails
Remember that Mailpit is for development only. In production:
- Configure a proper email service provider (Resend, SendGrid, etc.)
- Set up proper email authentication (SPF, DKIM)
- Use production-grade SMTP settings
- Monitor email deliverability
Using a different email provider during local development
If you want to use a different email provider, switch the environment variables at apps/web/.env.development:
EMAIL_SENDER=test@makerkit.devEMAIL_PORT=EMAIL_HOST=EMAIL_TLS=EMAIL_USER=EMAIL_PASSWORD=Conclusion
Mailpit is a valuable tool for local development, allowing you to:
- Test email flows without sending real emails
- Iterate quickly on email templates
- Debug email-related issues
- Develop with confidence
Remember to switch to a proper email provider when deploying to production!