Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

adonis
web development

How to set up Mailtrap for AdonisJs

Educative Answers Team

Mailtrap is a fake SMTP server that comes in handy when catching test emails sent during development and staging.

Steps

Follow the steps below to set up Mailtrap for an AdonisJs application.

1. Create an account

To create an account, go to https://mailtrap.io.

2. Obtain the username and password

After you log in successfully, the homepage will appear.

svg viewer
The homepage

Next, click on the settings button. The following will appear:

svg viewer
The SMTP settings

Then, click on “Show Credentials” and copy the username and password.

svg viewer
View credentials

3. Edit the .env file

Add the following to the .env file of your application:

MAIL_CONNECTION=smtp
SMTP_HOST=smtp.mailtrap.io
MAIL_USERNAME=
MAIL_PASSWORD=

Paste your Mailtrap username and password that you copied earlier in front of MAIL_USERNAME and MAIL_PASSWORD, respectively. Save the .env file and try to send an email from the AdonisJs application. The email should appear in your Mailtrap inbox.

RELATED TAGS

adonis
web development
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses