在 CentOS 7 中使用 Sendmail 通过 PHP 发送邮件
如果你运行了一个web服务器或者一台VPS,你可能需要在你的PHP程序中发送邮件。FrancescoMondello
如果你运行了一个 web 服务器或者一台 VPS ,你可能需要在你的 PHP 程序中发送邮件。 Francesco Mondello
安装38%
使用 PHP 发送一封测试邮件53%
编译自: https://fasterland.net/sendingemailviaphpcentos7usingsendmail.html 作者: Francesco Mondello译者: geekpi
同样,如果你正在运行一个 WordPress 博客,或者你正在使用任何类型的 CMS ,你允许你的访问者通过联系表单向你发送电子邮件(例如使用 WordPress 的 Contact Form 7[1] 插件),你可能需要安装一个名为 sendmail[2] 的简单的程序到你的 web 服务器上。
Sendmail 可以通过你的发行版的软件包管理器安装。
安装
# yum install sendmail
如果在 CentOS 7 中使用了 SELinux, 你需要使用下面的命令允许 sendmail 发送邮件:
使用 PHP 发送一封测试邮件
php a
mail('user@receiver.com', "Test email", "Test email from the Internet", null, "f user@sender.com");
浏览 sendmail 日志
tail /var/log/maillog
via: https://fasterland.net/sendingemailviaphpcentos7usingsendmail.html
本文由 LCTT[5] 原创编译,Linux中国 荣誉推出
[1]: Contact Form 7 https://wordpress.org/plugins/contactform7/
[3]: 来自 Wikipedia https://en.wikipedia.org/wiki/Sendmail
[5]: LCTT https://github.com/LCTT/TranslateProject
本文由 帝一博客 原创发布。用户在本站发布的原创内容(包括但不仅限于回答、文章和评论),著作权均归用户本人所有。独家文章转载,请联系邮箱:17762131@qq.com。获得授权后,须注明本文地址: https://bubukou.com/phpjiqiao/105.html
-
PHP 扫描微信公众号二维码,关注并自动登录网站
2020-10-27 16:35
-
fastadmin git 安装过程记录笔记
2020-10-03 17:34
-
PHP 多个redis key 删除遇到Function R...
2020-08-19 16:01
-
PHP-Redis,keys()对键名进行模糊查询
2020-08-19 15:34
-
php连接redis
2019-12-16 10:00
-
linux mshowfat命令显示MS-DOS文件在FAT...
2019-09-05 08:02
-
PHP中重定向网页跳转页面的方法
2019-07-09 11:38
-
CI框架中使用join实现多表联合查询
2019-06-13 20:56
-
Laravel 5.3 学习笔记之错误日志
2019-06-13 20:56
-
PHP批量生成静态HTML的简单原理和方法
2019-06-13 20:55
网友留言评论