安装mailcatcher

安装rvm & ruby

\curl -sSL https://get.rvm.io | bash -s stable
rvm install 1.9
rvm use 1.9 --default

更改gem源

gem sources
gem sources -r https://rubygems.org/
gem sources -a http://ruby.taobao.org/

安装mailcatcher

gem install mailcatcher
mailcatcher --http-ip=0.0.0.0
# browser visit http://[ip]:1080/

配置php

# vim /usr/local/php/etc/php.ini
send_mail_path = /usr/bin/env catchmail
# service php-fpm restart

测试

# php -a
mail('245565986@qq.com', 'test email', 'email\'s content is written by xiaozi.');

标签: none

添加新评论