aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/class_smtp_mail.inc.php1
-rw-r--r--include/functions_mail.inc.php6
2 files changed, 3 insertions, 4 deletions
diff --git a/include/class_smtp_mail.inc.php b/include/class_smtp_mail.inc.php
index b26ef1ed4..93521c81e 100644
--- a/include/class_smtp_mail.inc.php
+++ b/include/class_smtp_mail.inc.php
@@ -132,6 +132,7 @@ class smtp_mail
$this->server_write('MAIL FROM:<'.$this->email_webmaster.'>'."\r\n");
$this->server_parse('250');
+ // Add "To:" on headers if there are included
if ((preg_match('/^\s*to\s*:.*/mi', $headers) === 0) and !empty($to))
{
$to_header = 'To:'.implode(',', array_map(create_function('$email','return "<".$email.">";'), explode(',', $to)));
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 68d8dd37c..e38ef44b6 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -608,12 +608,10 @@ function pwg_mail($to, $args = array())
$headers.= 'Reply-To: '.$args['from']."\n";
if (empty($to))
{
+ // Add only when to is empty
+ // else mail() add 'To:' on header
$headers.= 'To: undisclosed-recipients: ;'."\n";
}
- else
- {
- $headers.= 'To: '.$to."\n";
- }
if (!empty($args['Cc']))
{