Receive emails with Laravel Mail Catcher

Aug 31, 2020 PHP Beginner Laravel mailcatcher Laravel7

Purpose

Implementation environment

Item Information
OS macOS Catalina(10.15.5)
Hardware MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
Processor 2 GHz Quad Core Intel Core i5
Memory 32 GB 3733 MHz LPDDR4
Graphics Intel Iris Plus Graphics 1536 MB
Item Information Remarks
PHP version 7.4.3 Introduced using Homwbrew
Laravel version 7.0.8 Introduced by this method using commposer → Construct environment of Mac Laravel
MySQL version 8.0.19 for osx10.13 on x86_64 Introduced by this method using Homwbrew → Install MySQL with Mac Homebrew

#Prerequisites

#Prerequisite information

After reading

Overview

  1. Installing and starting MailCatcher
  2. Description of .env file
  3. Confirm

#Details

  1. Installing and starting MailCatcher

    1. Execute the following command to install MailCatcher.

      $ sudo gem install mailcatcher
      
    2. Execute the following command to start MailCatcher.

      $ mailcatcher
      
    3. Access the following. -http://127.0.0.1:1080

    4. Confirm that the following page is displayed.

      68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f3330363431372f39633163623538302d383264352d623939322d316433652d6336323034666432623038392e706e67.png

  2. Description of .env file

    1. Modify the Mail setting part of the .env file as follows.

      MAIL_DRIVER=smtp
      MAIL_HOST=127.0.0.1
      MAIL_PORT=1025
      MAIL_ENCRYPTION=null
      [email protected]
      MAIL_FROM_NAME=admin
      MAIL_USERNAME=null
      MAIL_PASSWORD=null
      MAIL_PRETEND=false
      
  3. Confirm

    1. Send an email from the Laravel app.

    2. When MailCatcher is displayed on the browser as shown below and it is confirmed that the mail can be received, the work is completed.

      MailCatcher__1_.png