Under Windows, I found sendmail_from needed to be a valid email address which has been defined on the mail server being addressed.
Laufzeit-Konfiguration
Das Verhalten dieser Funktionen wird durch Einstellungen in der php.ini beeinflusst.
| Name | Standard | Veränderbar | Changelog |
|---|---|---|---|
| mail.add_x_header | "0" | PHP_INI_PERDIR | Verfügbar seit PHP 5.3.0. |
| mail.log | NULL | PHP_INI_PERDIR | Verfügbar seit PHP 5.3.0. |
| SMTP | "localhost" | PHP_INI_ALL | |
| smtp_port | "25" | PHP_INI_ALL | Verfügbar seit PHP 4.3.0. |
| sendmail_from | NULL | PHP_INI_ALL | |
| sendmail_path | "/usr/sbin/sendmail -t -i" | PHP_INI_SYSTEM |
Hier eine kurze Erklärung der Konfigurationsoptionen:
-
mail.add_x_headerbool -
Fügt den X-PHP-Originating-Script-Header hinzu, der die UID des Skripts gefolgt vom Dateinamen enthält.
-
mail.logstring -
Der Pfad zur Log-Datei, in der mail()-Aufrufe geloggt werden. Die Log-Einträge enthalten den vollen Pfad des Skripts, die Zeilennummer, die To-Adresse und alle Header.
-
SMTPstring -
Wird nur unter Windows benutzt: Hostname oder IP-Adresse des SMTP-Servers, den PHP für Mails, die mit der mail()-Funktion verschickt werden, nutzen soll.
-
smtp_portint -
Wird nur unter Windows benutzt: Nummer des Ports des Servers (angegeben in der SMTP-Option), um eine Verbindung herzustellen, wenn eine Mail mit der mail()-Funktion verschickt wird. Standardwert ist 25. Diese Option ist verfügbar ab PHP 4.3.0.
-
sendmail_fromstring -
"From:"-Mail-Adresse, die beim Mail-Versand unter Windows benutzt werden soll. Diese Direktive setzt auch den "Return-Path:" Header.
-
sendmail_pathstring -
Pfad, in dem sich das sendmail-Programm befindet, z.B. /usr/sbin/sendmail oder /usr/lib/sendmail. configure versucht, die richtige Position automatisch zu finden. Falls die automatische Erkennung aber fehlschlägt und der Standardwert auf Ihrem Rechner falsch ist, dann können Sie hier den richtigen Pfad setzen.
Falls Sie auf Ihrem Rechner sendmail nicht benutzen, müssen Sie den Pfad angeben, in sich der sendmail-Wrapper/-Ersatz befindet, sofern vorhanden. Zum Beispiel können » Qmail-Benutzer diese Option auf /var/qmail/bin/sendmail oder /var/qmail/bin/qmail-inject setzen.
qmail-inject benötigt keine Optionen, um Mails korrekt zu verarbeiten.
Diese Option funktioniert auch unter Windows. Wenn Sie gesetzt ist, werden smtp, smtp_port und sendmail_from ignoriert und das angegebene Kommando wird ausgeführt.
The mail.add_x_header configuration value is set to "On" in the default production php.ini (although the default value of this setting is Off)
Despite what this page says about the "SMTP" and "smtp_port" settings being used only under Windows, all Drupal sites use these settings to send email, regardless of which OS they're running in.
For linux you can over-ride the default "From" for the outgoing emails by including in php.ini this line:
sendmail_path = "/usr/sbin/sendmail -t -i -f fromMe@blah.com"
The path should work for most linux installations.
On Darwin OS such as OSX (current one: 10.8.3) you need to add a specific command and option to the sendmail_path constant if you have downloaded and installed a mamp with a stack.
Indeed you can see the required libraries for PHP, Apache, MySQL in "common/lib" folder. The problem is when you run an external command using these libraries, for example "sendmail". It could be a problem if it gets the stack libraries and not the system ones (different versions, etc).
The "env -i" command clean the Stack environment variables and run "sendmail" with the system libraries.
Hope this helps.
