是否可以将PHP配置为使用postfix配置集发送电子邮件?
WordPress(通过PHPMailer)依赖于这些设置在php.ini中是正确的:
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/sbin/sendmail -t -i"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
mail.log = /var/log/mail.log
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
Postfix配置为使用Google的SMTP服务器并确认在操作系统(Ubuntu 14.04)级别工作
PHPMailer失败(来自WordPress),错误:
无法实例化邮件功能。
答案 0 :(得分:0)
原来因为我使用的是php-fpm,有些设置我不知道设置在/etc/php5/mods-available/zzzz_custom.ini中。
将sendmail路径添加到该文件对我有用:
sendmail_path=/usr/sbin/sendmail -t -i