Ist es möglich, weisen Sie PHP postfix-Konfiguration in php.ini?

Ist es möglich, PHP zu konfigurieren, um E-Mail senden mit der Konfiguration für postfix?

WordPress (via PHPMailer) stützt sich auf diese Einstellungen korrekt in 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 ist konfiguriert für die Verwendung mit Google ' s SMTP-server und bestätigt, sobald die Arbeit an der OS (Ubuntu 14.04) Ebene

PHPMailer ausfällt (von WordPress) mit der Fehlermeldung:

Konnte nicht instanziiert mail-Funktion.

  • Diese Kombination funktioniert out of the box für mich. Tut /usr/sbin/sendmail vorhanden??? Haben Sie eigene php.ini-Dateien für cli-und web-server SAPIs? Sie könnten versuchen, mithilfe von SMTP an localhost, das ist die empfohlene Art zu sprechen, um einen lokalen postfix-Instanz, da es schneller als das aufrufen einer sendmail-binary.
  • Danke für die Antwort. Sendmail existiert in diesem Pfad. Es sind eigene php.ini-Dateien - gleiche Einstellungen. Seine php-fpm ob das einen Unterschied macht. Ich bin ein Neustart von php-fpm statt apache (aber habe beide ausprobiert). Ich habe nun versucht, die SMTP-Einstellungen zu - gleicher Fehler.
  • Sie können nicht mithilfe von SMTP wenn Sie, dass Fehler, wie es tritt nur auf, wenn Sie anrufen E-mail()
  • Vielen Dank - du hattest Recht. Es war eine andere ini-Datei überschreiben alle Einstellungen, die ich gemacht php.ini (siehe meine Antwort). Vielen Dank für Eure Hilfe 🙂
InformationsquelleAutor codecowboy | 2015-02-11
Schreibe einen Kommentar