email testing using mailtrap

Safe email testing in laravel using mailtrap

Email testing is very easy in laravel using mailtrap.

Mailtrap

Mailtrap is a fake SMTP server for development teams to test, view and share emails sent from the development and staging environments without spamming real customers.

Mailtrap’s basic plan is free and limited but you can easily upgrade to another plan as per your need.
It is platform-independent. You can use it with any programming language and framework because Mailtrap uses SMTP. for more visit: Mailtrap.io

Installation

Let’s install Laravel via Composer

Authentication implementation in Laravel is very easy.

Just run

and

in a terminal.

Mailtrap in Laravel

Laravel supports mailtrap out of the box. you just have to set few settings and you are done. very easy. Lets do it step by step.

1. Create account in mailtrap.io

  • Sign up for an account if not already
  • Create inbox if not already:
    mailtrap-inbox
  • Click on inbox name, you’ll get SMTP setting screen.This screen also has Integration details for languages and frameworks.We’ll going to use username and password from this screen.
    mailtrap-setting

2. Configure .env file

3. Test email with mailtrap
Let’s use built in authentication system of laravel.
click on forgot your password link and provide your registered email address.

reset-password-mailtrap

You will get email in your inbox.

received-email

That’s it.

 

Video Tutorial:

Leave a Comment