summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/mail.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/inc/mail.php b/inc/mail.php
index 1f4acf346..5cd7db13d 100644
--- a/inc/mail.php
+++ b/inc/mail.php
@@ -71,6 +71,12 @@ function _mail_send_action($data) {
// No named recipients for To: in Windows (see FS#652)
$usenames = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true;
+ // On Unix set the envelope headers correctly:
+ if($usenames){
+ if($from) $params = ((string) $params).' -f '.escapeshellarg($from);
+ if($to) $params = ((string) $params).' '.escapeshellarg($to);
+ }
+
$to = mail_encode_address($to,'',$usenames);
$header .= mail_encode_address($from,'From');
$header .= mail_encode_address($cc,'Cc');