转载自:http://mabblog.com/blog/2011/09/lion-smtp-postfix-relay-and-dreamhost/

When developing web-apps locally it is useful to have a fully functional smtp server to test automated emails associated with your application. Many times the network you are developing on will not allow you to simply start up postfix and and run your own local
smtp server. However, this doesn’t imply that you can’t use postfix – modifying postfix to relay all outgoing mail to an external / offsite smtp server that you have control of will enable you to develop & test the parts of your application that require a
local outgoing smtp server without an issue.

Many times port 25 (the default smtp port) will be blocked somewhere along the line in your network connection. You can figure out if your network configuration or ISP is blocking port 25 by running

telnet smtp.server.com 25.

Edit /etc/postfix/main.cf

relayhost = [mail.domain.com]:587

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options = noanonymous

smtp_use_tls = yes

Create/edit /etc/postfix/sasl_passwd

[mail.domain.com]:587 username@domain.com:password

Run this command in your shell once the above two files are created/modified:

sudo chmod 600 /etc/postfix/sasl_passwd

sudo postmap /etc/postfix/sasl_passwd

sudo launchctl stop org.postfix.master

sudo launchctl start org.postfix.master



# test postfix, cmd+d after typing message content to send message

mail -s "Testing, Testing" you@domain.com

PHP mac localhost 环境下发送邮件的更多相关文章

  1. 在Mac OS环境下安装MySQL服务

    在Mac OS环境下安装MySQL服务 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 我之前介绍过window环境下安装mysql服务,以及在Linux环境下安装mysql服务,今 ...

  2. 桂电在linux、Mac OS环境下使用出校器(支持2.14)

    这是guetsec学长在三院科协学长所抓包逆向分析1.81版出校器的基础上,用python写的一款为Mac和linux环境开发的出校器. 最后我做了略微修改,支持暂时最新版本2.14.下面有直接从源码 ...

  3. Mac+Docker环境下xdebug的配置

    由于容器化的需要,前几天我本地也换成了docker环境.就研究了一下docker环境下phpstorm和xdebug的配置. http://www.mmfei.com/?p=453 这个博客给出了一个 ...

  4. Mac OS环境下媒体文件分割工具mediafilesegmenter的简单使用(生成M3U8 TS文件)

    mediafilesegmenter是苹果开发的一款用于分割媒体文件的工具,其功能与mediastreamsegmenter相似,但操作更简单. * 具体可以对比博客中的另一篇简介<Mac OS ...

  5. 用C#(ASP.Net)在Exchange Server环境下发送邮件

    普通的邮件, 用System.Net.Mail 类 或 System.Web.Mail 类 处理即可, 但是Exchange Server 环境下, 这两个类起不了作用-------至少目前我看到的情 ...

  6. Mac python3 环境下 完善pdf转jpg脚本

    由于样本图片数据都是保存在pdf里,想拿到样本必须先把图片从pdf中提取出来,算是数据清洗中的一点小小的积累吧. 这里不得不吐槽一下公司存储图片的机制,业务员把jpg格式的照片放到word里,然后用工 ...

  7. MAC OSX环境下cordova+Ionic的安装配置

    一.简介 1.Ionic是什么 IONIC 是目前最有潜力的一款 HTML5 手机应用开发框架.通过 SASS 构建应用程序,它提供了很多 UI 组件来帮助开发者开发强大的应用. 它使用 JavaSc ...

  8. Mac OS环境下配置Myeclipse2015的经验

    反复测试装了多次,现在把成功安装的方法陈列如下: 1. 相关的资源: (1)下载 myeclipse-2015-stable-2.0-offline-installer-macosx.dmg 链接:h ...

  9. Mac OS 环境下 安装 Asp.Net及使用Yeoman 创建Asp.Net 项目

    本文是按照英文原文:Installing ASP.NET 5 On Mac OS安装时遇到的问题的总结Blog. 原文提示如下: Installing ASP.NET 5 On Mac OS XBy ...

随机推荐

  1. Codeforces6E_Exposition

    题意 给定一个序列,求有多少个最长连续子序列满足最大值减最小值之差不超过\(k\). 分析 跟序列最大值最小值有关的可以想到单调栈,先预处理出每个数作为最大值能延伸的区间,然后枚举每个数作为最大值. ...

  2. 2018icpc宁夏邀请赛网络赛_G_Trouble of Tyrant

    题意 一列\(n\)个点,给定一个特殊的图,有两种边\(E(1,i)\)和\(E(i-1,i)\),多个询问,每次给一个\(d\),求所有路径长度加上\(d\)后1到\(n\)的最短路. 分析 首先这 ...

  3. Jade学习(二)之语法规则上

    语法 ⚠️实例均结合node jade缩进代表层级 html <html></html> html <html> head <head> style & ...

  4. 一个常用的通过curl发送HTTP请求的函数

    function: function curl_get($url, $params) { return curl_http($url, $params, 'GET'); } function curl ...

  5. 手把手教你上传文件到GitHub上(已获取ssh密钥)

    如何提交一个文件到GitHub(已经生成ssh key) 1.新建一个文件夹,当作本地仓库 2.初始化仓库 $git init 3.将想要上传的东西复制到仓库中 4.将文件提交到暂存区 $git ad ...

  6. 使用git配置ssh的文章推荐

    https://blog.51cto.com/sgk2011/1925922 https://www.cnblogs.com/superGG1990/p/6844952.html https://bl ...

  7. 万兴神剪手 Wondershare Filmora v9.2.11.6 简体中文版

    目录 1. 介绍 2. 简体中文9.2.1.10汉化版下载 3. 安装和激活说明 1. 介绍 万兴神剪手 Filmora 是一款界面简洁时尚.功能强大的视频编辑软件,它是深圳万兴科技公司近年来的代表作 ...

  8. php中禁止单个ip与ip段访问的代码小结

    1.禁止单个IP <?php //IP访问限制 if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP' ...

  9. python算法(一)基本知识&冒泡排序&选择排序&插入排序

    本节内容: 算法基本知识 冒泡排序 选择排序 插入排序 1. 算法基本知识 1.1 什么是算法? 算法(algorithm):就是定义良好的计算过程,他取一个或一组的值为输入,并产生出一个或一组值作为 ...

  10. Django学习系列2:django环境中安装selenium并查看selenium版本号

    在Django环境中安装selenium (django) root@ranxf-TEST:/studydisk/Python_web_TDD/superlists# conda install se ...