Using Homebrew install mailhog
and enable the service as instructed in the installation.
Open in any browser http://localhost:8025
Edit file /etc/postfix/main.cf
sudo vim /etc/postfix/main.cf
and add in the following below the commented out relayhosts :-
myhostname = localhost
.
.
.
# find relayhost section and add:
relayhost = [localhost]:1025
sudo launchctl stop org.postfix.master
sudo launchctl start org.postfix.master
test by sending the contents of a directory to an email address with the following:
tree /var/www/somefolder | mail -s "contents" [email protected]
If you receive the following error:
send-mail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory
you can do the following:
sudo mkdir -p /Library/Server/Mail/Data/spool
sudo /usr/sbin/postfix set-permissions
sudo /usr/sbin/postfix start
as per this question.
NB: If things aint sending / receiving, and you're getting notices, check that the mail servers you're using are actually working!
Hi Madalin! Since this is meant for web development, can you please also share the sendmail_path that you are using in your php configuration?