Home > php教程 > php手册 > Mac OSX 配置PHP Mail

Mac OSX 配置PHP Mail

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:11:44
Original
1747 people have browsed it

我们将实现以下功能点: 如何让自己的Mac电脑能成为一个localhost mail server(本地邮件服务器),能直接发送邮件; 在Mac OSX 系统实现PHP mail() function 的功能; 修改PHP的主要配置文件php.ini 文件,开启在类Unix系统下PHP mail() function的发送邮件

我们将实现以下功能点:

  1. 如何让自己的Mac电脑能成为一个localhost mail server(本地邮件服务器),能直接发送邮件;
  2. 在Mac OSX 系统实现PHP mail() function 的功能;

Mac OSX PHP Mail Postfix

修改PHP的主要配置文件php.ini 文件,开启在类Unix系统下PHP mail() function的发送邮件功能:

sendmail_path = “env -i /usr/sbin/sendmail -t -i”

然后重启Apache服务器或者Nginx服务器等。

开启邮件服务

发送邮件主要由Mail Transfer Agent (MTA) 邮件传输代理来实现,常用的MTA有PostfixSendmail等。

然而MAC OSX 系统 已经预装了Postfix服务,我们就不需要再安装一次了,直接开启就OK了。

$ sudo postfix start
postfix/postfix-script: starting the Postfix mail system

查看Postfix是否启动了,只需查看一下进程是否创建了。

lixi$ ps -ef | grep postfix
0 45793???? 1?? 0? 5:50下午 ?????????? 0:00.03 /usr/libexec/postfix/master

查看Postfix安装在哪儿?

$ which postfix
/usr/sbin/postfix

测试Postfix是否能成功代理发送邮件

$ date | mail -s testing name@gmail.com

查看邮件发送队列

$ mailq
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
9E7D8276E30*???? 369 Sun Feb 23 18:39:42? user@userdeMacBook-Pro.local
name@gmail.com

打开Gmail查看是否存在testing标题的邮件。

(...)
Read the rest of Mac OSX 配置PHP Mail (27 words)


© Li Xi for LixiPHP, 2014. | Permalink | No comment | Add to del.icio.us
Post tags: Function, Mac, mail, OSX, Postfix, 邮件服务器

Feed enhanced by Better Feed from Ozh

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mac use
From 1970-01-01 08:00:00
0
0
0
How to install it on Mac?
From 1970-01-01 08:00:00
0
0
0
Why doesn’t Mac have PHPstudy?
From 1970-01-01 08:00:00
0
0
0
When will phpstudy release a mac version?
From 1970-01-01 08:00:00
0
0
0
Where is the telnet option on mac computer?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template