LoginSignup
1
1

More than 1 year has passed since last update.

MailHogでテスト用SMTPサーバを構築する

Posted at

概要

alpine + golangでWebアプリを実装した際に、メール送信機能の動作確認のため簡単なSMTPサーバが必要になり、MailHogを導入したので手順を書いておく。あくまでもWebアプリのメール送信機能が動作していることを確認するのが目的なので、外部へのメール配信は想定しない。

インストール

# go install github.com/mailhog/MailHog@latest

SMTPサーバ起動

# MailHog -smtp-bind-addr 127.0.0.1:25 -storage maildir -maildir-path /var/tmp/mail

これで127.0.0.1:25でSMTPサーバが起動する。送信されたメールは/var/tmp/mail以下に保存される。

1
1
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
1
1