From 5d110184c06f937d41fff3e0cc4d4d40314caf72 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Tue, 31 Mar 2009 10:47:22 -0400 Subject: [PATCH] - Fix using mail() on Windows (#1485779) --- program/steps/mail/func.inc | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index a76532c..f9d560a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1308,7 +1308,14 @@ // reset stored headers and overwrite $message->_headers = array(); $header_str = $message->txtHeaders($headers_php); - + + // #1485779 + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + if (preg_match_all('/<([^@]+@[^>]+)>/', $headers_enc['To'], $m)) { + $headers_enc['To'] = implode(', ', $m[1]); + } + } + if (ini_get('safe_mode')) $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str); else -- Gitblit v1.9.1