LoginSignup
0
0

More than 3 years have passed since last update.

AWS EC2 AmazonLinux2に導入したMailCatcherでLaravelのメールの受け取りを行う

Posted at

目的

  • AWS EC2 AmazonLinux2インスタンスに導入したMailCatcherにてLaravelから送られてきたメールを受け取る方法をまとめる

前提条件

  • AWS EC2 AmazonLinux2インスタンスにLaravelの動作環境が構築されていること。

前提情報

読後感

  • AWSのインスタンス内に構築したLaravelアプリから送信されたメールを同じインスタンス内に導入されたMailCatcherで受け取ることができる。

概要

  1. MailCatcherの導入
  2. .envファイルの記載
  3. 確認

詳細

  1. MailCatcherの導入
    1. 下記の方法でAWS EC2 AmazonLinux2にMailCatcherを導入する。
  2. .envファイルの記載

    1. .envファイルのMail設定部分を下記の様に修正する。

      MAIL_DRIVER=smtp
      MAIL_HOST=127.0.0.1
      MAIL_PORT=1025
      MAIL_ENCRYPTION=null
      MAIL_FROM_ADDRESS=admin@gmail.com
      MAIL_FROM_NAME=admin
      MAIL_USERNAME=null
      MAIL_PASSWORD=null
      MAIL_PRETEND=false
      
  3. 確認

    1. Laravelアプリからメールを送信する。
    2. 下記の様にブラウザでMailCatcherを表示しメールが受信できていることを確認したら作業完了である。

      MailCatcher__1_.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0