Appwrite: set up email sending under 10 minutes
A quick guide how to set up mail setting under 10 minutes
Every app needs email sending capabilites weather it's for password reset or invitations or whatever - appwrite has everything prepared for it, we just need to use the given options.
Because SMTP servers are hard to setup and maintain, we'll use a third party API to provide our SMTP needs.
Mailgun side settings
Since mailgun is super easy to setup and use, we'll use it as our SMTP provider.
After a successful registration:
- Navigato to sending -> overview
- Select SMTP
- Those are the credits that are needed for us in the later setup
E.g.:
I already reset this password, so no worries about that 😊
Appwrite setting
After grabbing our settings we need to setup for appwrite:
- Navigate to your installation forlder for me it's in
~/appwrite
- Start to edit your
.env
in the folder - After you've edited the file restart the appwrite compose
You'll need to edit: _APP_SMTP_HOST
, _APP_SMTP_PORT
, _APP_SMTP_SECURE
, _APP_SMTP_USERNAME
and _APP_SMTP_PASSWORD
.
Optionally you can also edit: _APP_SYSTEM_EMAIL_ADDRESS
- this is the sender's email, for this short example I left as is.
E.g.:
To restart appwrite you first need to stop the containers:
$ docker-compose stop
Then after the containers are stopped - restart it:
$ docker-compose up -d
These commands should be executed from your appwrite installation folder, for me: ~/appwrite
.
Aaand that's it, you've successfully setup email sending for your appwrite. To try out go to your console, select a project, settings and invite a new member for it. After you've sent the email mailgun should show something like this:
Closing thoughts
You can also read the full instructions about email sending in appwrite docs.
I hope you've found this quick article about email setup useful. 😊
Thank you for reading, and let's connect!
Thank you for reading my post! Feel free to subscribe to my email newsletter and connect on LinkedIn or Twitter 😊