此方式需要服务器安装postfix,可以在Linux系统下直接使用sendmail命令查看是否安装
注:send-mail: fatal: parameter inet_interfaces: no local interface found for ::1 错误解决: - vi /etc/postfix/main.cf
- 发现配置为:
- inet_interfaces = localhost
- inet_protocols = all
- 改成:
- inet_interfaces = all
- inet_protocols = all
- 重新启动
- service postfix start
复制代码
支持同时向多个邮件地址发送
- include_once libfile('function/mail');
- $sendto = "<js_mawentao@163.com>,<didilangbi@163.com>";
- sendmail($sendto,"测试邮件","休息休息","xxx@163.com");
复制代码
出问题查看日志
/var/log/maillog
|