网站首页 > 开源技术 正文
如何Ubuntu/CentOS服务器下配置sendmail组件并实现WordPress邮件通知?很简单,只需要通过几条命令安装sendmail组件即可。
1、安装sendmail
sudo apt-get install sendmail //安装sendmail,CentOS执行命令:yum install sendmail
sudo service sendmail start //启动服务
2、设置sendmail开机自动运行
编辑/etc/rc.local ,在exit 0语句前加入:service sendmail start
或者使用,两种方法
apt-get install chkconfig //如果没有安装chkconfig,执行此命令,CentOS执行命令yum install chkconfig
chkconfig sendmail on
3、修改php.ini配置,调用sendmail功能
vi /usr/local/php/etc/php.ini
找到sendmail_path的那一行,去掉注释并改成如下:
sendmail_path = /usr/sbin/sendmail -t –i
4、重启服务器
最后,可以使用探针测试下,代码如下:
<?php $txt = "hello,you are a good boy!"; // 以下的邮箱地址改成你的 $mail = '10001@qq.com'; // 发送邮件 mail($mail, "My subject", $txt); echo 'message was sent!'; ?>
猜你喜欢
- 2024-10-03 「趣站」火狐推出的一次性文件分享服务,“阅后即焚”Firefox Send
- 2024-10-03 触发式邮件群发自动化解决用户全方面问题
- 2024-10-03 四十六、UiPath: Send SMTP Mail Message 发送带附件的邮件(转)
- 2024-10-03 操作界面就像 Line,微软推出上班族专属电邮“Send”
- 2024-10-03 linux服务器大量的sendmail及postdrop进程故障排查
- 2024-10-03 在CentOS 上使用Sendmail 发邮件(linux sendmail发送邮件)
- 2024-10-03 写给未来的一封Email:SendCloud与您的一年之约!
- 2024-06-24 发信息不说send massage!刷屏说成brush screen老师会被你气死
- 2024-06-24 知识教程 | sendEvent、execScript的应用附源码(下)
- 2024-06-24 "发信息" 不是send message!"刷屏"也不要说成brush screen!
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)