Skip to content

Instantly share code, notes, and snippets.

@gh-darvishani
Last active July 26, 2023 06:20
Show Gist options
  • Save gh-darvishani/f8b31156222125dcb6e1a93418b6fb1e to your computer and use it in GitHub Desktop.
Save gh-darvishani/f8b31156222125dcb6e1a93418b6fb1e to your computer and use it in GitHub Desktop.
install MailHog , php , brew ,go ,mhsendmail
#install mail-hog:
brew install mailhog
#install go-lang
brew install go
#install mhsendmail
go install github.com/mailhog/mhsendmail@latest
#change php config
find php.ini
php -i | grep 'php.ini'
nano /opt/homebrew/etc/php/7.4/php.ini :
SMTP = 0.0.0.0
smtp_port = 1025
sendmail_from = gh@macbook.com
sendmail_path = /usr/bin/env /Users/<your-username>/go/bin/mhsendmail -f gh@macbook.com
#restart php & apache (httpd) :
sudo apachectl restart
brew services restart php@7.4
#open:
http://127.0.0.1:8025/
@gh-darvishani
Copy link
Author

use php mail function to send mail :
mail("gh.darvishani@live.com","My subject","test from your macbook")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment