Setup Mailhog mail server on Ubuntu

How to setup Mailhog mail server on Ubuntu

install Go (since mailhog is written in Go)

sudo apt-get install golang-go
mkdir gocode
echo "export GOPATH=$HOME/gocode" >> ~/.profile
source ~/.profile

install mailhog

go get github.com/mailhog/MailHog
go get github.com/mailhog/mhsendmail

make binaries global - replace USERNAME with your OS username

sudo cp /home/USERNAME/gocode/bin/MailHog /usr/local/bin/mailhog
sudo cp /home/USERNAME/gocode/bin/mhsendmail /usr/local/bin/mhsendmail

install PHP

sudo apt install php7.2-cli

edit php.ini

cd /etc/php/7.2/cli/
nano php.ini

Start mailhog (manually): enter in terminal

mailhog \
  -api-bind-addr 127.0.0.1:8025 \
  -ui-bind-addr 127.0.0.1:8025 \
  -smtp-bind-addr 127.0.0.1:1025

emails will appear in mailhog dashboard at the port address:

http://127.0.0.1:8025

SNAPPED!

SNAPPED!

Comments

Post a Comment

Popular posts from this blog

Append to a json file python