DockerのWordPressでmailcatcherにSMTP送信の設定

設定をメモ、Dockerはdocker-compose.ymlで以下のように定義

version: "3.5"
services:
  wordpress:
    image: wordpress:latest
    ports:
      - 80:80
    links:
      - wordpress-db
    environment:
      WORDPRESS_DB_HOST: wordpress-db:3306
      WORDPRESS_DB_NAME: wp
      WORDPRESS_DB_USER: wp
      WORDPRESS_DB_PASSWORD: pass
    volumes:
      - ./dist:/var/www/html
      - ./php.ini:/usr/local/etc/php/php.ini
  wordpress-db:
    image: mysql:5.7
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: pass
    volumes:
      - ./db/mysql_init:/docker-entrypoint-initdb.d
      - ./db/mysql_data:/var/lib/mysql
  mailcatcher:
    image: schickling/mailcatcher
    ports:
      - 1080:1080
      - 1025:1025

SMTPは、WP Mail SMTP プラグインを利用してますその設定。

  • From Email : デフォルト
  • From Name : デフォルト
  • Mailer : Other SMTP
  • SMTP Host : mailcatcher (docker-compose.ymlの設定に合わせる)
  • SMTP Port : 1025 (docker-compose.ymlの設定に合わせる)
  • Auto TLS : OFF
  • Authentication : OFF