Under Windows, I found sendmail_from needed to be a valid email address which has been defined on the mail server being addressed.
Configuración en tiempo de ejecución
El comportamiento de estas funciones se ve afectado por la configuración de php.ini.
| Nombre | Por defecto | Cambiable | Historial de cambios |
|---|---|---|---|
| mail.add_x_header | "0" | PHP_INI_PERDIR | Disponible a partir de PHP 5.3.0. |
| mail.log | NULL | PHP_INI_PERDIR | Disponible a partir de PHP 5.3.0. |
| SMTP | "localhost" | PHP_INI_ALL | |
| smtp_port | "25" | PHP_INI_ALL | Disponible a partir de PHP 4.3.0. |
| sendmail_from | NULL | PHP_INI_ALL | |
| sendmail_path | "/usr/sbin/sendmail -t -i" | PHP_INI_SYSTEM |
He aquí una breve explicación de las directivas de configuración.
-
mail.add_x_headerbool -
Añade X-PHP-Originating-Script que incluirá el UID del script seguido por el nombre del fichero.
-
mail.logstring -
La ruta al archivo log que registrará todos los llamados a la función mail(). Las entradas de registro incluyen la ruta completa al script, número de línea, dirección To y cabeceras.
-
SMTPstring -
Únicamente bajo Windows: nombre del servidor o dirección IP del servidor SMTP que debe usar PHP para enviar los correos con la función mail().
-
smtp_portint -
Únicamente bajo Windows: número del puerto al que conectar en el servidor especificado en las opciones SMTP cuando se envíe un correo con mail(); por defecto 25. Disponible desde PHP 4.3.0.
-
sendmail_fromstring -
Cual dirección de correo "From:" debe ser usada como remitente del correo enviado por PHP bajo Windows. Esta directiva también establece el valor de la cabecera "Return-Path:".
-
sendmail_pathstring -
Ruta donde puede encontrarse el programa sendmail, generalmente /usr/sbin/sendmail o /usr/lib/sendmail. configure intenta localizarlo para establecerlo por defecto, pero si falla, se usa esta variable.
Los sistemas que no usen sendmail deberían establecer esta directiva al wrapper o sistema alternativo que ofrezca el sistema de correo, si tiene. Por ejemplo, usuarios de » Qmail pueden fijar como valor /var/qmail/bin/sendmail o /var/qmail/bin/qmail-inject.
qmail-inject no requiere ninguna opción para procesar correo correctamente.
Esta directiva funciona también bajo Windows. Si se le da un valor, smtp, smtp_port y sendmail_from son ignorados y se ejecuta el comando especificado.
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.
