install mailhog on Ubuntu

Install Go programming language and Configure home directory for Go language

cd ~
curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
tar xvf go1.6.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
mkdir ./work

#Install MailHog Main GitHub repo
Download link for MailHog

cd ~/
wget https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linu...
sudo cp MailHog_linux_amd64 /usr/bin/mailhog
#Install mhsendmail, sendmail replacement for MailHog GitHub repo

sudo go get github.com/mailhog/mhsendmail
This will install mhsendmail to ~/go/bin/mhsendmail, to insatll globally

sudo ln ~/work/bin/mhsendmail /usr/bin/mhsendmail
sudo ln ~/work/bin/mhsendmail /usr/bin/sendmail
sudo ln ~/work/bin/mhsendmail /usr/bin/mail
#Configure PHP Add following line to php.ini

sendmail_path = /usr/bin/mhsendmail

The code has been tested and works

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.